summaryrefslogtreecommitdiff
path: root/debian/apm/ifplugd
diff options
context:
space:
mode:
Diffstat (limited to 'debian/apm/ifplugd')
-rw-r--r--debian/apm/ifplugd22
1 files changed, 22 insertions, 0 deletions
diff --git a/debian/apm/ifplugd b/debian/apm/ifplugd
new file mode 100644
index 0000000..e2ecb17
--- /dev/null
+++ b/debian/apm/ifplugd
@@ -0,0 +1,22 @@
+#!/bin/sh
+# suspend ifplugd
+
+[ -f /etc/default/ifplugd ] || exit 0
+. /etc/default/ifplugd
+[ -z "${SUSPEND_ACTION}" -o x"${SUSPEND_ACTION}" = x"none" ] && exit 0
+
+if [ ${SUSPEND_ACTION} = "suspend" ] ; then
+ RESUME_ACTION="resume"
+elif [ ${SUSPEND_ACTION} = "stop" ] ; then
+ RESUME_ACTION="start"
+else
+ exit 0
+fi
+
+if [ "$1" = suspend ]; then
+ /etc/init.d/ifplugd ${SUSPEND_ACTION}
+elif [ "$1" = resume ] && [ "$2" != standby ]; then
+ /etc/init.d/ifplugd ${RESUME_ACTION}
+fi
+
+exit 0