summaryrefslogtreecommitdiffstats
path: root/network/iwd/rc.iwd
diff options
context:
space:
mode:
Diffstat (limited to 'network/iwd/rc.iwd')
-rw-r--r--network/iwd/rc.iwd35
1 files changed, 35 insertions, 0 deletions
diff --git a/network/iwd/rc.iwd b/network/iwd/rc.iwd
new file mode 100644
index 0000000000..ee61802358
--- /dev/null
+++ b/network/iwd/rc.iwd
@@ -0,0 +1,35 @@
+#!/bin/bash
+#
+# Start/stop/restart iwd.
+
+iwd_start() {
+ if [ -x /usr/libexec/iwd ]; then
+ echo "Starting iwd: /usr/libexec/iwd"
+ /usr/libexec/iwd 2>/dev/null &
+ fi
+}
+
+iwd_stop() {
+ echo "Stopping iwd"
+ killall iwd
+}
+
+iwd_restart() {
+ iwd_stop
+ sleep 1
+ iwd_start
+}
+
+case "$1" in
+'start')
+ iwd_start
+ ;;
+'stop')
+ iwd_stop
+ ;;
+'restart')
+ iwd_restart
+ ;;
+*)
+ echo "usage $0 start|stop|restart"
+esac