aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-connectivity/hostapd
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-connectivity/hostapd')
-rw-r--r--meta-oe/recipes-connectivity/hostapd/hostapd-2.2/init27
1 files changed, 24 insertions, 3 deletions
diff --git a/meta-oe/recipes-connectivity/hostapd/hostapd-2.2/init b/meta-oe/recipes-connectivity/hostapd/hostapd-2.2/init
index 79f74b681e..8ba4e07940 100644
--- a/meta-oe/recipes-connectivity/hostapd/hostapd-2.2/init
+++ b/meta-oe/recipes-connectivity/hostapd/hostapd-2.2/init
@@ -8,6 +8,23 @@ test -f $DAEMON || exit 0
set -e
+# source function library
+. /etc/init.d/functions
+
+delay_stop() {
+ count=0
+ while [ $count -lt 9 ] ; do
+ if pidof $DAEMON >/dev/null; then
+ sleep 1
+ else
+ return 0
+ fi
+ count=`expr $count + 1`
+ done
+ echo "Failed to stop $DESC."
+ return 1
+}
+
case "$1" in
start)
echo -n "Starting $DESC: "
@@ -16,20 +33,24 @@ case "$1" in
;;
stop)
echo -n "Stopping $DESC: "
- start-stop-daemon -K -x $DAEMON
+ start-stop-daemon -K --oknodo -x $DAEMON
echo "$NAME."
;;
restart)
$0 stop
- $0 start
+ delay_stop && $0 start
;;
reload)
echo -n "Reloading $DESC: "
killall -HUP $(basename ${DAEMON})
echo "$NAME."
;;
+ status)
+ status $DAEMON
+ exit $?
+ ;;
*)
- echo "Usage: $0 {start|stop|restart|reload}"
+ echo "Usage: $0 {start|stop|restart|reload|status}"
exit 1
;;
esac