- # Bring blue up (but not at boot)
- if [ "$(basename $0)" == "hostapd" ]; then
-
- if [ "$(INTERFACE)" == "blue0" ]; then
- /etc/rc.d/init.d/networking/blue start
- elif [ "$(INTERFACE)" == "green0" ]; then
- /etc/rc.d/init.d/networking/green start
+ echo driver=$driver > /etc/hostapd.conf.tmp
+ grep -v "^driver=" /etc/hostapd.conf >> /etc/hostapd.conf.tmp
+ mv /etc/hostapd.conf.tmp /etc/hostapd.conf
+
+ echo DRIVER=$DRIVER > /var/ipfire/wlanap/settings.tmp
+ grep -v "^DRIVER=" /var/ipfire/wlanap/settings >> /var/ipfire/wlanap/settings.tmp
+ chown nobody:nobody /var/ipfire/wlanap/settings.tmp
+ chmod 644 /var/ipfire/wlanap/settings.tmp
+ mv /var/ipfire/wlanap/settings.tmp /var/ipfire/wlanap/settings
+
+ if [ "$DRIVER" == "MADWIFI" ]; then
+ if [ "$(/usr/sbin/iwconfig $INTERFACE | /bin/grep "Mode:Master")" == "" ]; then
+ boot_mesg "Setting MADWIFI wlan $INTERFACE to Master mode... "
+ # Set Atheros Cards to master mode
+ /usr/bin/wlanconfig $INTERFACE destroy > /dev/null
+ /usr/bin/wlanconfig $INTERFACE create wlandev wifi0 wlanmode ap > /dev/null