From 9ddad8ae8d3f093db4474165a9e2d46d8dc08767 Mon Sep 17 00:00:00 2001 From: James Rayner Date: Mon, 7 Sep 2009 20:07:48 +1000 Subject: add an improved pm-utils handler --- contrib/11netcfg | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 contrib/11netcfg (limited to 'contrib/11netcfg') 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 $? + -- cgit v1.2.3-24-g4f1b