8 eval $
(/usr
/local
/bin
/readhash
/var
/ipfire
/wlanap
/settings
)
12 boot_mesg
"Starting hostapd... "
13 mkdir
-p /var
/run
/hostapd
14 # enable wlan module of collectd
15 sed -i -e "s|#LoadPlugin wireless|LoadPlugin wireless|g" /etc
/collectd.conf
17 # Set Atheros Cards to master mode
18 /usr
/bin
/wlanconfig
$INTERFACE destroy
> /dev
/null
19 /usr
/bin
/wlanconfig
$INTERFACE create wlandev wifi0 wlanmode ap
> /dev
/null
21 # Set other cards to master mode
22 #/usr/sbin/iwconfig blue0 mode master
24 if [ "$(/usr/sbin/iwconfig $INTERFACE | /bin/grep "Mode
:Master
")" == "" ]; then
25 boot_mesg
"Error! Can't set wlan master mode"
29 /usr
/sbin
/iwconfig
$INTERFACE channel
$CHANNEL
30 /usr
/sbin
/iwconfig
$INTERFACE txpower
$TXPOWER
31 /usr
/bin
/hostapd
-P /var
/run
/hostapd
/etc
/hostapd.conf
</dev
/tty12
>/dev
/tty12
2>&1 &
35 # Bring blue up (but not at boot)
36 if [ "$(basename $0)" == "hostapd" ]; then
38 /etc
/rc.d
/init.d
/networking
/${INTERFACE//[0-9]/} start
40 if [ -f /var
/ipfire
/dhcp
/enable_
${INTERFACE//[0-9]/} ]; then
41 /etc
/rc.d
/init.d
/dhcp restart
47 boot_mesg
"Stopping hostapd..."
49 # Set Atheros Card to managed mode
50 /usr
/bin
/wlanconfig
$INTERFACE destroy
> /dev
/null
51 /usr
/bin
/wlanconfig
$INTERFACE create wlandev wifi0 wlanmode sta
> /dev
/null
53 # Set other cards to managed mode
54 #/usr/sbin/iwconfig blue0 mode Managed
56 killproc
/usr
/bin
/hostapd
67 statusproc
/usr
/bin
/hostapd
71 echo "Usage: ${0} {start|stop|restart|status}"