diff options
author | James Rayner <james@archlinux.org> | 2008-08-06 14:39:11 +0200 |
---|---|---|
committer | James Rayner <james@archlinux.org> | 2008-08-06 14:39:11 +0200 |
commit | 7555beb8b9cf85e8106859e5e6fed7b028e0d08e (patch) | |
tree | 58f0b924e361d0544a1619aeb3aa23df164c5f5a /src | |
parent | ffae225ceb0bae05800a73817b7c022549d98d56 (diff) | |
download | netctl-7555beb8b9cf85e8106859e5e6fed7b028e0d08e.tar.gz netctl-7555beb8b9cf85e8106859e5e6fed7b028e0d08e.tar.xz |
Fix parsing of hex WPA keys
Diffstat (limited to 'src')
-rw-r--r-- | src/wireless.subr | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wireless.subr b/src/wireless.subr index d188d19..adabeb1 100644 --- a/src/wireless.subr +++ b/src/wireless.subr @@ -170,7 +170,9 @@ wireless_up() { echo "ctrl_interface_group=0" >> $WPA_CONF # Generate configuration - if ! wpa_passphrase "$ESSID" "$KEY" >> $WPA_CONF; then + if [[ "${#KEY}" == "64" ]]; then + echo -e 'network={ \nssid="$ESSID" \npsk=$KEY \n}'> $WPA_CONF + elif ! wpa_passphrase "$ESSID" "$KEY" >> $WPA_CONF; then err_append "Configuration generation failed: `cat $WPA_CONF`" return 1 fi |