diff options
author | James Rayner <james@archlinux.org> | 2009-09-07 12:07:48 +0200 |
---|---|---|
committer | James Rayner <james@archlinux.org> | 2009-09-07 12:07:48 +0200 |
commit | 9ddad8ae8d3f093db4474165a9e2d46d8dc08767 (patch) | |
tree | eb39e17dd3ca14553d188baa8d3673c1db22cbe1 /contrib/11netcfg | |
parent | 6b0c686613a26541ce3164d9e995f639ef3a9b9f (diff) | |
download | netctl-9ddad8ae8d3f093db4474165a9e2d46d8dc08767.tar.gz netctl-9ddad8ae8d3f093db4474165a9e2d46d8dc08767.tar.xz |
add an improved pm-utils handler
Diffstat (limited to 'contrib/11netcfg')
-rwxr-xr-x | contrib/11netcfg | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/contrib/11netcfg b/contrib/11netcfg new file mode 100755 index 0000000..9a453d9 --- /dev/null +++ b/contrib/11netcfg @@ -0,0 +1,44 @@ +#!/bin/bash + +source /usr/lib/pm-utils/functions +source /etc/pm/config.d/netcfg + +suspend_netcfg() { + case $NETCFG_SUSPEND in + daemons) + stopservice net-profiles + stopservice net-auto + ;; + retain|*) + netcfg all-suspend + ;; + esac +} + +resume_netcfg() { + case $NETCFG_SUSPEND in + daemons) + restartservice net-profiles + restartservice net-auto + ;; + retain|*) + netcfg all-resume + ;; + esac +} + +if [ -x /usr/bin/netcfg2 ]; then + case "$1" in + hibernate|suspend) + suspend_netcfg + ;; + thaw|resume) + resume_netcfg + ;; + *) + ;; + esac +fi + +exit $? + |