summaryrefslogtreecommitdiff
path: root/network/hostapd/rc.hostapd
diff options
context:
space:
mode:
authorMurat D. Kadirov <banderols@gmail.com>2010-05-12 17:43:26 +0200
committerRobby Workman <rworkman@slackbuilds.org>2010-05-12 17:43:26 +0200
commit4435bd3842ccfb0a803839ad7111b8ae9efa4278 (patch)
tree2f31ca7362c5f057558cda6bdbd0e27da57b018e /network/hostapd/rc.hostapd
parent83b561e314326cc8406d1ee1836bd2fdd38a7fba (diff)
downloadslackbuilds-4435bd3842ccfb0a803839ad7111b8ae9efa4278.tar.gz
network/hostapd: Updated for version 0.5.11
Diffstat (limited to 'network/hostapd/rc.hostapd')
-rw-r--r--network/hostapd/rc.hostapd42
1 files changed, 42 insertions, 0 deletions
diff --git a/network/hostapd/rc.hostapd b/network/hostapd/rc.hostapd
new file mode 100644
index 0000000000..c034284b8a
--- /dev/null
+++ b/network/hostapd/rc.hostapd
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+# Start/stop/restart the hostapd (IEEE 802.11 Wireless AP) server:
+
+hostapd_start() {
+ if test -r /var/run/hostapd.pid && ps $(cat /var/run/hostapd.pid) >& /dev/null; then
+ echo "HOSTAPD already running!"
+ else
+ CMD="/usr/sbin/hostapd -B -P /var/run/hostapd.pid /etc/hostapd/hostapd.conf"
+ echo "Starting HOSTAPD: $CMD"
+ $CMD
+ fi
+}
+
+hostapd_stop() {
+ if [ -r /var/run/hostapd.pid ]; then
+ echo -n "Stopping HOSTAPD ..."
+ kill -INT $(cat /var/run/hostapd.pid)
+ echo " done."
+ fi
+}
+
+hostapd_restart() {
+ hostapd_stop
+ sleep 3
+ hostapd_start
+}
+
+case "$1" in
+'start')
+ hostapd_start
+ ;;
+'stop')
+ hostapd_stop
+ ;;
+'restart')
+ hostapd_restart
+ ;;
+*)
+ echo "usage $0 start|stop|restart"
+esac
+