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