aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorTravis Kemen <thepeople@openwrt.org>2008-02-13 03:40:45 +0000
committerTravis Kemen <thepeople@openwrt.org>2008-02-13 03:40:45 +0000
commit77a0906bedb6bbfafb3bc7439416b0af14d16be0 (patch)
tree881c6f53e65a61a16386b7ebf6ac6ec2f71a5571 /package
parenta3dc37ebeffa7845ca9a3e9d7ebf32a3099a6066 (diff)
downloadupstream-77a0906bedb6bbfafb3bc7439416b0af14d16be0.tar.gz
upstream-77a0906bedb6bbfafb3bc7439416b0af14d16be0.tar.bz2
upstream-77a0906bedb6bbfafb3bc7439416b0af14d16be0.zip
fix problems with the use of a passphrase, add option to use a key instead of passphrase
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@10450 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rwxr-xr-xpackage/madwifi/files/lib/wifi/madwifi.sh18
1 files changed, 13 insertions, 5 deletions
diff --git a/package/madwifi/files/lib/wifi/madwifi.sh b/package/madwifi/files/lib/wifi/madwifi.sh
index 400cb77adc..fef63cbcc2 100755
--- a/package/madwifi/files/lib/wifi/madwifi.sh
+++ b/package/madwifi/files/lib/wifi/madwifi.sh
@@ -266,26 +266,34 @@ enable_atheros() {
fi
;;
wds|sta)
- case "$enc" in
+ config_get_bool usepassphrase "$vif" passphrase 1
+ case "$enc" in
PSK|psk|PSK2|psk2)
case "$enc" in
PSK|psk)
proto='proto=WPA'
- passphrase="${key}"
+ if [ "$usepassphrase" = "1" ]; then
+ passphrase="psk=\"${key}\""
+ else
+ passphrase="psk=${key}"
+ fi
;;
PSK2|psk2)
proto='proto=RSN'
- passphrase=`wpa_passphrase ${ssid} "${key}" | grep psk | grep -v \#| cut -d= -f2`
+ if [ "$usepassphrase" = "1" ]; then
+ passphrase="psk=\"${key}\""
+ else
+ passphrase="psk=${key}"
+ fi
;;
esac
-
cat > /var/run/wpa_supplicant-$ifname.conf <<EOF
network={
scan_ssid=1
ssid="$ssid"
key_mgmt=WPA-PSK
$proto
- psk=$passphrase
+ $passphrase
}
EOF
;;