summaryrefslogtreecommitdiffstats
path: root/contrib/11netcfg
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/11netcfg')
-rwxr-xr-xcontrib/11netcfg44
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 $?
+