]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - src/initscripts/init.d/hostapd
core76: Sort exclude file alphabetically.
[people/teissler/ipfire-2.x.git] / src / initscripts / init.d / hostapd
index 0cc95b7b4272240ffa3f9237b1a8360abf01a973..c0b11e6af6ee7f4c004120eefeb681abeddbd9c2 100644 (file)
@@ -3,6 +3,7 @@
 . ${rc_functions}
 
 CHANNEL="05"
+COUNTRY="00"
 TXPOWER="auto"
 INTERFACE="blue0"
 MACMODE="0"
@@ -40,8 +41,7 @@ case "${1}" in
                elif [ -e "/sys/class/net/$INTERFACE/madwifi_name_type" ]; then
                        DRIVER="MADWIFI"
                        driver="madwifi"
-               elif [ "$(/bin/grep hostap_pci /sys/class/net/$INTERFACE/uevent)" != "" ]; then
-               #PHYSDEVDRIVER=hostap_pci
+               elif [ "$(/bin/grep hostap /sys/class/net/$INTERFACE/uevent)" != "" ]; then
                        DRIVER="HOSTAP"
                        driver="hostap"
                else
@@ -70,12 +70,16 @@ case "${1}" in
                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 2.4 Cards 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
+               # First reset to World (00) and then set new country
+               /usr/sbin/iw reg set 00
+               /usr/sbin/iw reg set $COUNTRY
+
+               /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/null 2>&1 &