summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJouke Witteveen <j.witteveen@gmail.com>2013-02-23 11:10:14 +0100
committerJouke Witteveen <j.witteveen@gmail.com>2013-02-23 11:13:14 +0100
commitdbc2cb76d631046ddc6039523595eeb962e5f454 (patch)
treec0afd8f58b28dd45affce8fbf3edbd8060ee7844 /services
parentc446fad51d232e6553ca42bcba5930d9cb8556c6 (diff)
downloadnetctl-dbc2cb76d631046ddc6039523595eeb962e5f454.tar.gz
netctl-dbc2cb76d631046ddc6039523595eeb962e5f454.tar.xz
Introduce sleep hook (FS#33829)
This adds a store/restore hook to the sleep target of systemd. Thanks to: Claudio Kozický.
Diffstat (limited to 'services')
-rw-r--r--services/netctl-sleep.service13
1 files changed, 13 insertions, 0 deletions
diff --git a/services/netctl-sleep.service b/services/netctl-sleep.service
new file mode 100644
index 0000000..301dc36
--- /dev/null
+++ b/services/netctl-sleep.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=netctl sleep hook
+Before=sleep.target
+StopWhenUnneeded=yes
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/bin/netctl store ; /usr/bin/netctl stop-all
+ExecStop=-/usr/bin/netctl restore
+
+[Install]
+WantedBy=sleep.target