X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/aa350ee98d884d49abd2a92716291489e00e954e..ef5d60de3b2c9a8e2b23145a70d24fc91c790c2d:/package/madwifi/files/lib/wifi/madwifi.sh diff --git a/package/madwifi/files/lib/wifi/madwifi.sh b/package/madwifi/files/lib/wifi/madwifi.sh index cc340977b..001ea0933 100755 --- a/package/madwifi/files/lib/wifi/madwifi.sh +++ b/package/madwifi/files/lib/wifi/madwifi.sh @@ -78,6 +78,7 @@ enable_atheros() { local first=1 for vif in $vifs; do + local start_hostapd nosbeacon= config_get ifname "$vif" ifname config_get enc "$vif" encryption @@ -137,7 +138,6 @@ enable_atheros() { [ -n "$wdssep" ] && iwpriv "$ifname" wdssep "$wdssep" } - wpa= case "$enc" in WEP|wep) for idx in 1 2 3 4; do @@ -151,8 +151,8 @@ enable_atheros() { *) iwconfig "$ifname" enc "$key";; esac ;; - PSK|psk|PSK2|psk2) - config_get key "$vif" key + psk*|wpa*) + start_hostapd=1 ;; esac @@ -261,7 +261,7 @@ enable_atheros() { config_get_bool isolate "$vif" isolate 0 iwpriv "$ifname" ap_bridge "$((isolate^1))" - if eval "type hostapd_setup_vif" 2>/dev/null >/dev/null; then + if [ -n "$start_hostapd" ] && eval "type hostapd_setup_vif" 2>/dev/null >/dev/null; then hostapd_setup_vif "$vif" madwifi || { echo "enable_atheros($device): Failed to set up hostapd for interface $ifname" >&2 # make sure this wifi interface won't accidentally stay open without encryption