3 # hostapd This script is used to start and stop hostapd service
7 # description: hostapd is a deamon to run wlan card based on prism2
8 # chip as Access Point.
10 # Author: Pawel Bernadowski "pbern" <kontakt@pbern.biz>
13 # Source function library
14 . /etc/rc.d/init.d/functions
17 . /etc/sysconfig/network
19 # Check that networkin is up
20 if is_yes "${NETWORKING}"; then
21 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
22 msg_network_down hostapd
30 # See how we were called.
33 # Check if the service is already running?
34 if [ ! -f /var/lock/subsys/hostapd ]; then
36 daemon /sbin/hostapd /etc/hostap/hostapd.conf -B
38 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/hostapd
40 msg_already_running hostapd
44 if [ -f /var/lock/subsys/hostapd ]; then
48 rm -f /var/lock/subsys/hostapd >/dev/null 2>&1
50 msg_not_running hostapd
63 msg_usage "$0 {start|stop|restart|force-reload|status}"