mac80211: fix client mode
authorFelix Fietkau <nbd@openwrt.org>
Sun, 28 Feb 2010 19:02:05 +0000 (19:02 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 28 Feb 2010 19:02:05 +0000 (19:02 +0000)
SVN-Revision: 19915

package/mac80211/files/lib/wifi/mac80211.sh

index f127b285662c521b67e6e637003a6e49f740aa63..87f7d29daad7c03ca80735feaaa8cb5d9da63c3f 100644 (file)
@@ -329,20 +329,20 @@ enable_mac80211() {
                start_hostapd=1
        done
 
-       [ -n "$start_hostapd" ] || return 0
+       [ -n "$start_hostapd" ] && {
+               hostapd -P /var/run/wifi-$phy.pid -B /var/run/hostapd-$phy.conf || {
+                       echo "Failed to start hostapd for $phy"
+                       return
+               }
+               sleep 2
 
-       hostapd -P /var/run/wifi-$phy.pid -B /var/run/hostapd-$phy.conf || {
-               echo "Failed to start hostapd for $phy"
-               return
+               for vif in $vifs; do
+                       config_get mode "$vif" mode
+                       config_get ifname "$vif" ifname
+                       [ "$mode" = "ap" ] || continue
+                       mac80211_start_vif "$vif" "$ifname"
+               done
        }
-       sleep 2
-
-       for vif in $vifs; do
-               config_get mode "$vif" mode
-               config_get ifname "$vif" ifname
-               [ "$mode" = "ap" ] || continue
-               mac80211_start_vif "$vif" "$ifname"
-       done
 
        for vif in $vifs; do
                config_get mode "$vif" mode