7 boot_mesg
"Starting hostapd... "
8 mkdir
-p /var
/run
/hostapd
9 # enable wlan module of collectd
10 sed -i -e "s|#LoadPlugin wireless|LoadPlugin wireless|g" /etc
/collectd.conf
12 # Set Atheros Card to master mode
13 /usr
/bin
/wlanconfig blue0 destroy
> /dev
/null
14 /usr
/bin
/wlanconfig blue0 create wlandev wifi0 wlanmode ap
> /dev
/null
16 # Set other cards to master mode
17 #/usr/sbin/iwconfig blue0 mode master
19 if [ "$(/usr/sbin/iwconfig blue0 | /bin/grep "Mode
:Master
")" == "" ]; then
20 boot_mesg
"Error! Can't set wlan master mode"
24 /usr
/sbin
/iwconfig blue0 channel
05
25 /usr
/bin
/hostapd
-P /var
/run
/hostapd
/etc
/hostapd.conf
</dev
/tty12
>/dev
/tty12
2>&1 &
31 boot_mesg
"Stopping hostapd..."
33 # Set Atheros Card to Managed mode
34 /usr
/bin
/wlanconfig blue0 destroy
> /dev
/null
35 /usr
/bin
/wlanconfig blue0 create wlandev wifi0 wlanmode sta
> /dev
/null
37 # Set other cards to master mode
38 #/usr/sbin/iwconfig blue0 mode Managed
40 killproc
/usr
/bin
/hostapd
51 statusproc
/usr
/bin
/hostapd
55 echo "Usage: ${0} {start|stop|restart|status}"