diff options
author | Koen Kooi <koen@openembedded.org> | 2005-06-30 08:19:37 +0000 |
---|---|---|
committer | OpenEmbedded Project <openembedded-devel@lists.openembedded.org> | 2005-06-30 08:19:37 +0000 |
commit | c8e5702127e507e82e6f68a4b8c546803accea9d (patch) | |
tree | 00583491f40ecc640f2b28452af995e3a63a09d7 /packages/wpa-supplicant/files/init.sh | |
parent | 87ec8ca4d2e2eb4d1c1e1e1a6b46a395d56805b9 (diff) |
import clean BK tree at cset 1.3670
Diffstat (limited to 'packages/wpa-supplicant/files/init.sh')
-rwxr-xr-x[-rw-r--r--] | packages/wpa-supplicant/files/init.sh | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/packages/wpa-supplicant/files/init.sh b/packages/wpa-supplicant/files/init.sh index e69de29bb2..bc7ee9184e 100644..100755 --- a/packages/wpa-supplicant/files/init.sh +++ b/packages/wpa-supplicant/files/init.sh @@ -0,0 +1,50 @@ +#!/bin/sh + +PATH=/sbin:/bin:/usr/sbin:/usr/bin + +DAEMON=/usr/sbin/wpa_supplicant +CONFIG="/etc/wpa_supplicant.conf" +PNAME="wpa_supplicant" + +# insane defaults +OPTIONS="" + +test -f /etc/default/wpa && . /etc/default/wpa + +if [ ! -f $CONFIG ]; then + echo "No configuration file found, not starting." + exit 1 +fi + +test -f $DAEMON || exit 0 + +case "$1" in + start) + echo -n "Starting wpa_supplicant: " + start-stop-daemon -S -b -x $DAEMON -- -Bw -c $CONFIG $OPTIONS >/dev/null + echo "done." + ;; + stop) + echo -n "Stopping wpa_supplicant: " + start-stop-daemon -K -n $PNAME >/dev/null + echo "done." + ;; + reload|force-reload) + echo -n "Reloading wpa_supplicant: " + killall -HUP $PNAME + echo "done." + ;; + restart) + echo -n "Restarting wpa_supplicant: " + start-stop-daemon -K -n $PNAME >/dev/null + sleep 1 + start-stop-daemon -S -b -x $DAEMON -- -Bw -c $CONFIG $OPTIONS >/dev/null + echo "done." + ;; + *) + echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 |