summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouke Witteveen <j.witteveen@gmail.com>2012-04-16 17:32:20 +0200
committerJouke Witteveen <j.witteveen@gmail.com>2012-04-16 17:32:20 +0200
commit250aa4794191a6bd8805555a5fd76d1fc6e3b5ea (patch)
tree50417c309ac97d327ce29527e039851394513a6e
parent3cfb2c957a25f5c934e921f6bca49283f2919442 (diff)
downloadnetctl-250aa4794191a6bd8805555a5fd76d1fc6e3b5ea.tar.gz
netctl-250aa4794191a6bd8805555a5fd76d1fc6e3b5ea.tar.xz
Add pm-utils support
Moved from the pm-utils package.
-rw-r--r--Makefile1
-rwxr-xr-xscripts/pm-utils26
2 files changed, 27 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 3c11be5..312d2c2 100644
--- a/Makefile
+++ b/Makefile
@@ -25,6 +25,7 @@ install: install-docs
scripts/wifi-menu \
$(DESTDIR)/usr/bin/
install -Dm755 scripts/ifplugd.action $(DESTDIR)/etc/ifplugd/netcfg.action
+ install -Dm755 scripts/pm-utils $(DESTDIR)/usr/lib/pm-utils/sleep.d/11netcfg
# Daemons
install -Dm755 rc.d/net-set-variable $(DESTDIR)/etc/rc.d/functions.d/net-set-variable
install -m755 \
diff --git a/scripts/pm-utils b/scripts/pm-utils
new file mode 100755
index 0000000..311851f
--- /dev/null
+++ b/scripts/pm-utils
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+. /usr/lib/pm-utils/functions
+
+suspend_netcfg() {
+ netcfg all-suspend
+}
+
+resume_netcfg() {
+ netcfg all-resume
+}
+
+if [ -x /usr/bin/netcfg ]; then
+ case "$1" in
+ hibernate|suspend)
+ suspend_netcfg
+ ;;
+ thaw|resume)
+ resume_netcfg
+ ;;
+ *)
+ ;;
+ esac
+fi
+
+exit $?