diff options
Diffstat (limited to 'src/hostapd/hostapd')
-rwxr-xr-x | src/hostapd/hostapd | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/hostapd/hostapd b/src/hostapd/hostapd new file mode 100755 index 0000000..b4709d7 --- /dev/null +++ b/src/hostapd/hostapd @@ -0,0 +1,35 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/conf.d/hostapd + +case "$1" in + start) + stat_busy "Starting hostapd" + /usr/bin/hostapd -B -P ${HOSTAPD_PID} ${HOSTAPD_CONF} &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + stat_done + add_daemon hostapd + fi + ;; + stop) + stat_busy "Stopping hostapd" + [ -f ${HOSTAPD_PID} ] && kill `cat ${HOSTAPD_PID}` &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + stat_done + rm_daemon hostapd + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac |