diff options
author | Jouke Witteveen <j.witteveen@gmail.com> | 2012-08-08 12:36:30 +0200 |
---|---|---|
committer | Jouke Witteveen <j.witteveen@gmail.com> | 2012-08-08 13:16:31 +0200 |
commit | 7b8dee2209da8a0db1722562fc33fad336eafc8d (patch) | |
tree | c8d727db46b35c9e4c71c5ed190b8df4aaa346e7 /scripts | |
parent | 11ba258a774f72818b4c79fbc61596fe5880e837 (diff) | |
download | netctl-7b8dee2209da8a0db1722562fc33fad336eafc8d.tar.gz netctl-7b8dee2209da8a0db1722562fc33fad336eafc8d.tar.xz |
Fix key handling in netcfg
Mainly a regression (7e2ff).
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/wifi-menu | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/wifi-menu b/scripts/wifi-menu index 08268a1..043bc79 100755 --- a/scripts/wifi-menu +++ b/scripts/wifi-menu @@ -102,7 +102,7 @@ create_profile() local box flags key msg security PROFILE="$INTERFACE-${1//\//_}" [[ -e "$PROFILE_DIR/$PROFILE" ]] && PROFILE+=".wifi-menu" - flags=$(grep -F -m 1 $'\t'"$1\$" "$NETWORKS" | cut -f 2) + flags=$(grep -m 1 $'\t'"$1\$" "$NETWORKS" | cut -f 2) if [[ "$flags" =~ WPA|WEP ]]; then security=${BASH_REMATCH[0],,} else @@ -115,9 +115,9 @@ create_profile() [[ "${#key}" -ge 8 && "${#key}" -le 63 ]] || return 4 if [[ "$OBSCURE" ]]; then key=$(wpa_passphrase "$1" "$key" | grep -m 1 "^[[:space:]]*psk=") - key="KEY=${key#*psk=}" + key=${key#*psk=} else - key="KEY=$(printf "%q" "$key")" + key=$(printf "%q" "$key") fi fi cat << EOF > "$PROFILE_DIR/$PROFILE" @@ -127,7 +127,7 @@ INTERFACE='$INTERFACE' SECURITY='$security' ESSID=$(printf "%q" "$1") IP='dhcp' -$key +${key+KEY=$key} EOF printf "%s" "$PROFILE" return 0 |