summaryrefslogtreecommitdiff
path: root/openembedded/packages/wpa-supplicant/files/init.sh
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2005-08-31 10:45:47 +0000
committerRichard Purdie <richard@openedhand.com>2005-08-31 10:45:47 +0000
commit4b46c1f6e891b1ddd5968536440b888661fade3e (patch)
treee0ba2c1f56f61b868bf746da5c4feabb25b800b2 /openembedded/packages/wpa-supplicant/files/init.sh
downloadopenembedded-core-4b46c1f6e891b1ddd5968536440b888661fade3e.tar.gz
openembedded-core-4b46c1f6e891b1ddd5968536440b888661fade3e.tar.bz2
openembedded-core-4b46c1f6e891b1ddd5968536440b888661fade3e.zip
Initial population
git-svn-id: https://svn.o-hand.com/repos/poky@1 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'openembedded/packages/wpa-supplicant/files/init.sh')
-rwxr-xr-xopenembedded/packages/wpa-supplicant/files/init.sh50
1 files changed, 50 insertions, 0 deletions
diff --git a/openembedded/packages/wpa-supplicant/files/init.sh b/openembedded/packages/wpa-supplicant/files/init.sh
new file mode 100755
index 0000000000..bc7ee9184e
--- /dev/null
+++ b/openembedded/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