]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/initscripts/init.d/hostapd
Some work on hostapd initscript
[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 boot_mesg -n "Starting hostapd... "
8 # enable wlan module of collectd
9 sed -i -e "s|#LoadPlugin wireless|LoadPlugin wireless|g" /etc/collectd.conf
10 /usr/bin/wlanconfig ath0 destroy
11 /usr/bin/wlanconfig blue0 create wlandev wifi0 wlanmode ap
12 /usr/sbin/iwconfig blue0 channel 05
13 /usr/bin/hostapd -P /var/run/hostapd /etc/hostapd.conf </dev/tty12 >/dev/tty12 2>&1 &
14 evaluate_retval
15 ;;
16
17 stop)
18 boot_mesg "Stopping hostapd..."
19 # Just make sure when going down the first time blue0 nw values are ignored
20 grep -v 'NAME="blue0"' /etc/udev/rules.d/30-persistent-network.rules > /tmp/30-persistent-network.rules
21 mv /tmp/30-persistent-network.rules /etc/udev/rules.d/30-persistent-network.rules
22 /usr/bin/wlanconfig blue0 destroy
23 killproc /usr/bin/hostapd
24 evaluate_retval
25 ;;
26
27 restart)
28 ${0} stop
29 sleep 1
30 ${0} start
31 ;;
32
33 status)
34 statusproc /usr/bin/hostapd
35 ;;
36
37 *)
38 echo "Usage: ${0} {start|stop|restart|status}"
39 exit 1
40 ;;
41 esac