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 if [ -d /proc
/net
/madwifi
/ath
0/ ]; then
19 /usr
/bin
/wlanconfig ath0 destroy
> /dev
/null
21 /usr
/bin
/wlanconfig
$INTERFACE destroy
> /dev
/null
22 /usr
/bin
/wlanconfig
$INTERFACE create wlandev wifi0 wlanmode ap
> /dev
/null
24 # Set other cards to master mode
25 #/usr/sbin/iwconfig blue0 mode master
27 if [ "$(/usr/sbin/iwconfig $INTERFACE | /bin/grep "Mode
:Master
")" == "" ]; then
28 boot_mesg
"Error! Can't set wlan master mode"
32 /usr
/sbin
/iwconfig
$INTERFACE channel
$CHANNEL
33 /usr
/sbin
/iwconfig
$INTERFACE txpower
$TXPOWER
34 /usr
/bin
/hostapd
-P /var
/run
/hostapd
/etc
/hostapd.conf
</dev
/tty12
>/dev
/tty12
2>&1 &
38 # Bring blue up (but not at boot)
39 if [ "$(basename $0)" == "hostapd" ]; then
41 /etc
/rc.d
/init.d
/networking
/${INTERFACE//[0-9]/} start
43 if [ -f /var
/ipfire
/dhcp
/enable_
${INTERFACE//[0-9]/} ]; then
44 /etc
/rc.d
/init.d
/dhcp restart
50 boot_mesg
"Stopping hostapd..."
52 # Set Atheros Card to managed mode
53 /usr
/bin
/wlanconfig
$INTERFACE destroy
> /dev
/null
54 /usr
/bin
/wlanconfig
$INTERFACE create wlandev wifi0 wlanmode sta
> /dev
/null
56 # Set other cards to managed mode
57 #/usr/sbin/iwconfig blue0 mode Managed
59 killproc
/usr
/bin
/hostapd
64 boot_mesg
"Stopping hostapd..."
65 killproc
/usr
/bin
/hostapd
70 boot_mesg
"Starting hostapd... "
71 if [ "$(/usr/sbin/iwconfig $INTERFACE | /bin/grep "Mode
:Master
")" == "" ]; then
72 boot_mesg
"Error! Card is not master"
76 /usr
/sbin
/iwconfig
$INTERFACE channel
$CHANNEL
77 /usr
/sbin
/iwconfig
$INTERFACE txpower
$TXPOWER
78 /usr
/bin
/hostapd
-P /var
/run
/hostapd
/etc
/hostapd.conf
</dev
/tty12
>/dev
/tty12
2>&1 &
85 statusproc
/usr
/bin
/hostapd
89 echo "Usage: ${0} {start|stop|restart|status}"