xref: /OK3568_Linux_fs/buildroot/package/iwd/S40iwd (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1#!/bin/sh
2
3DAEMON="/usr/libexec/iwd"
4PIDFILE="/var/run/iwd.pid"
5
6IWD_ARGS=""
7
8[ -r "/etc/default/iwd" ] && . "/etc/default/iwd"
9
10start() {
11	printf "Starting iwd:"
12	mkdir -p /tmp/iwd/hotspot
13	start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "$DAEMON" \
14		-- $IWD_ARGS
15	status=$?
16	if [ "$status" -eq 0 ]; then
17		echo "OK"
18	else
19		echo "FAIL"
20	fi
21	return "$status"
22}
23
24stop() {
25	printf "Stopping iwd:"
26	start-stop-daemon -K -q -p "$PIDFILE"
27	status=$?
28	if [ "$status" -eq 0 ]; then
29		echo "OK"
30	else
31		echo "FAIL"
32	fi
33	return "$status"
34}
35
36case "$1" in
37	start|stop)
38		"$1";;
39	*)
40		echo "Usage: $0 {start|stop}"
41		exit 1
42esac
43