summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/netctl.special.7.txt5
-rw-r--r--services/netctl-sleep.service13
2 files changed, 18 insertions, 0 deletions
diff --git a/docs/netctl.special.7.txt b/docs/netctl.special.7.txt
index 6e80d7d..9520385 100644
--- a/docs/netctl.special.7.txt
+++ b/docs/netctl.special.7.txt
@@ -38,6 +38,11 @@ systemctl disable netctl@<profile>
This way the unit configuration file for the profile remains in
existence, while the profile is not enabled.
+netctl-sleep.service::
+ When enabled, this unit stores and stops the active network profiles
+ before the machine is put to sleep. After the system is resumed,
+ previously stored profiles are restarted.
+
netctl-auto@<interface>.service::
This unit issues a scan on the interface it is used for and tries to
start a profile for a network it finds. It is targeted to wireless
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