]>
Commit | Line | Data |
---|---|---|
07603508 CS |
1 | #!/bin/sh |
2 | . /etc/sysconfig/rc | |
3 | . ${rc_functions} | |
4 | ||
5 | case "${1}" in | |
6 | start) | |
06391e6d | 7 | boot_mesg -n "Starting hostapd... " |
aced02fa | 8 | mkdir -p /var/run/hostapd |
d2c65e37 AF |
9 | # enable wlan module of collectd |
10 | sed -i -e "s|#LoadPlugin wireless|LoadPlugin wireless|g" /etc/collectd.conf | |
cca44919 AF |
11 | /usr/bin/wlanconfig ath0 destroy |
12 | /usr/bin/wlanconfig blue0 create wlandev wifi0 wlanmode ap | |
07603508 | 13 | /usr/sbin/iwconfig blue0 channel 05 |
06391e6d | 14 | /usr/bin/hostapd -P /var/run/hostapd /etc/hostapd.conf </dev/tty12 >/dev/tty12 2>&1 & |
07603508 CS |
15 | evaluate_retval |
16 | ;; | |
17 | ||
18 | stop) | |
06391e6d | 19 | boot_mesg "Stopping hostapd..." |
d2c65e37 | 20 | # Just make sure when going down the first time blue0 nw values are ignored |
06391e6d AF |
21 | grep -v 'NAME="blue0"' /etc/udev/rules.d/30-persistent-network.rules > /tmp/30-persistent-network.rules |
22 | mv /tmp/30-persistent-network.rules /etc/udev/rules.d/30-persistent-network.rules | |
23 | /usr/bin/wlanconfig blue0 destroy | |
07603508 CS |
24 | killproc /usr/bin/hostapd |
25 | evaluate_retval | |
26 | ;; | |
27 | ||
28 | restart) | |
29 | ${0} stop | |
30 | sleep 1 | |
31 | ${0} start | |
32 | ;; | |
33 | ||
34 | status) | |
35 | statusproc /usr/bin/hostapd | |
36 | ;; | |
37 | ||
38 | *) | |
39 | echo "Usage: ${0} {start|stop|restart|status}" | |
40 | exit 1 | |
41 | ;; | |
42 | esac |