X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=package%2Fmadwifi%2Ffiles%2Flib%2Fwifi%2Fmadwifi.sh;h=bec72383b38153e28c9bd3894fba3ae78bac40e0;hb=8c8b85b54c38de89392342c4959de0ae49afd148;hp=284c6609c6a7b3f2ac83f5bde476f39c01208722;hpb=89a9d76c8b8d8c61708038af8ce462fb3933d0c0;p=openwrt%2Fstaging%2Fdedeckeh.git diff --git a/package/madwifi/files/lib/wifi/madwifi.sh b/package/madwifi/files/lib/wifi/madwifi.sh index 284c6609c6..bec72383b3 100755 --- a/package/madwifi/files/lib/wifi/madwifi.sh +++ b/package/madwifi/files/lib/wifi/madwifi.sh @@ -262,7 +262,7 @@ enable_atheros() { if eval "type hostapd_setup_vif" 2>/dev/null >/dev/null; then hostapd_setup_vif "$vif" madwifi || { - echo "enable_atheros($device): Failed to set up wpa for interface $ifname" >&2 + 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 ifconfig "$ifname" down wlanconfig "$ifname" destroy @@ -271,80 +271,14 @@ enable_atheros() { fi ;; wds|sta) - config_get_bool usepassphrase "$vif" passphrase 1 - case "$enc" in - PSK|psk|PSK2|psk2) - case "$enc" in - PSK|psk) - proto='proto=WPA' - if [ "$usepassphrase" = "1" ]; then - passphrase="psk=\"${key}\"" - else - passphrase="psk=${key}" - fi - ;; - PSK2|psk2) - proto='proto=RSN' - if [ "$usepassphrase" = "1" ]; then - passphrase="psk=\"${key}\"" - else - passphrase="psk=${key}" - fi - ;; - esac - cat > /var/run/wpa_supplicant-$ifname.conf < /var/run/wpa_supplicant-$ifname.conf </dev/null >/dev/null; then + wpa_supplicant_setup_vif "$vif" madwifi || { + echo "enable_atheros($device): Failed to set up wpa_supplicant for interface $ifname" >&2 + ifconfig "$ifname" down + wlanconfig "$ifname" destroy + continue + } + fi ;; esac first=0