mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-12-18 10:25:00 +02:00
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
This commit is contained in:
parent
7b0cd54266
commit
b1f222f3f3
@ -266,26 +266,34 @@ enable_atheros() {
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
wds|sta)
|
wds|sta)
|
||||||
|
config_get_bool usepassphrase "$vif" passphrase 1
|
||||||
case "$enc" in
|
case "$enc" in
|
||||||
PSK|psk|PSK2|psk2)
|
PSK|psk|PSK2|psk2)
|
||||||
case "$enc" in
|
case "$enc" in
|
||||||
PSK|psk)
|
PSK|psk)
|
||||||
proto='proto=WPA'
|
proto='proto=WPA'
|
||||||
passphrase="${key}"
|
if [ "$usepassphrase" = "1" ]; then
|
||||||
|
passphrase="psk=\"${key}\""
|
||||||
|
else
|
||||||
|
passphrase="psk=${key}"
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
PSK2|psk2)
|
PSK2|psk2)
|
||||||
proto='proto=RSN'
|
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
|
esac
|
||||||
|
|
||||||
cat > /var/run/wpa_supplicant-$ifname.conf <<EOF
|
cat > /var/run/wpa_supplicant-$ifname.conf <<EOF
|
||||||
network={
|
network={
|
||||||
scan_ssid=1
|
scan_ssid=1
|
||||||
ssid="$ssid"
|
ssid="$ssid"
|
||||||
key_mgmt=WPA-PSK
|
key_mgmt=WPA-PSK
|
||||||
$proto
|
$proto
|
||||||
psk=$passphrase
|
$passphrase
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
;;
|
;;
|
||||||
|
Loading…
Reference in New Issue
Block a user