]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/initscripts/init.d/hostapd
Add cpufrequtils
[people/pmueller/ipfire-2.x.git] / src / initscripts / init.d / hostapd
1 #!/bin/sh
2 . /etc/sysconfig/rc
3 . ${rc_functions}
4
5 case "${1}" in
6 start)
7 # enable wlan module of collectd
8 sed -i -e "s|#LoadPlugin wireless|LoadPlugin wireless|g" /etc/collectd.conf
9 /usr/local/bin/wlanconfig ath0 destroy
10 /usr/local/bin/wlanconfig blue0 create wlandev wifi0 wlanmode ap
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)
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
19 /usr/local/bin/wlanconfig blue0 destroy
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