]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/initscripts/init.d/hostapd
Remove errormessage at hostapd channel set.
[people/pmueller/ipfire-2.x.git] / src / initscripts / init.d / hostapd
index 2cda1cfda28ef051aea2b7fa43c88b1f5b12ac05..31083399b18f83ce6191fbe597f3b9e45717dd1d 100644 (file)
@@ -17,7 +17,7 @@ case "${1}" in
 
                # Check Interface configuration
                if ! ip link show $INTERFACE > /dev/null 2>&1; then
-                       boot_mesg "Interface $INTERFACE does'nt exist." ${FAILURE}
+                       boot_mesg "Interface $INTERFACE doesn't exist." ${FAILURE}
                        echo_failure
                        exit 0
                fi
@@ -40,6 +40,9 @@ case "${1}" in
                elif [ -e "/sys/class/net/$INTERFACE/madwifi_name_type" ]; then
                        DRIVER="MADWIFI"
                        driver="madwifi"
+               elif [ "$(/bin/grep hostap /sys/class/net/$INTERFACE/uevent)" != "" ]; then
+                       DRIVER="HOSTAP"
+                       driver="hostap"
                else
                        boot_mesg "Interface $INTERFACE is a not supported wireless device." ${FAILURE}
                        echo_failure
@@ -63,14 +66,20 @@ case "${1}" in
                                /usr/bin/wlanconfig $INTERFACE destroy > /dev/null
                                /usr/bin/wlanconfig $INTERFACE create wlandev wifi0 wlanmode ap > /dev/null
                        fi
+               elif [ "$DRIVER" == "HOSTAP" ]; then
+                       if [ "$(/usr/sbin/iwconfig $INTERFACE | /bin/grep "Mode:Master")" == "" ]; then
+                               boot_mesg "Setting HOSTAP wlan $INTERFACE to Master mode... "
+                               # Set Prism Cards to master mode
+                               /usr/bin/iwconfig $INTERFACE mode master > /dev/null
+                       fi
                fi
 
-               /usr/sbin/iwconfig $INTERFACE channel $CHANNEL
+               /usr/sbin/iwconfig $INTERFACE channel $CHANNEL 2>/dev/null
                /usr/sbin/iwconfig $INTERFACE txpower $TXPOWER
 
-               /usr/bin/hostapd -P /var/run/hostapd /etc/hostapd.conf </dev/tty12 >/dev/tty12 2>&1 &
+               /usr/bin/hostapd -P /var/run/hostapd /etc/hostapd.conf >/dev/null 2>&1 &
 
-               sleep 1
+               sleep 2
 
                if [ $DRIVER == "MADWIFI" ]; then
                        iwpriv $INTERFACE maccmd 3
@@ -86,15 +95,13 @@ case "${1}" in
                        fi
                fi
 
-               sleep 1
+               sleep 2
 
                if [ "$(/usr/sbin/iwconfig $INTERFACE | /bin/grep "Mode:Master")" == "" ]; then
                        boot_mesg "Error! Can't set wlan master mode"
                        echo_failure;
                        exit 0;
                else
-                       # enable wlan module of collectd
-                       sed -i -e "s|#LoadPlugin wireless|LoadPlugin wireless|g" /etc/collectd.conf
                        echo_ok
                fi
                ;;