scripts

shell scripts
git clone git://git.bitsmanent.org/scripts
Log | Files | Refs | README

commit 6962b986514dd606b86176d5f77be087a68a2289
parent bc3c63e9c8ff33b927fd130c379e9bfbbec5d59a
Author: Claudio Alessi <smoppy@gmail.com>
Date:   Sat, 29 Oct 2016 20:08:57 +0200

Use wpa_passphrase.

Diffstat:
Msrc/iwpick | 12+++---------
1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/iwpick b/src/iwpick @@ -17,19 +17,13 @@ connect() { if [ -n "$key" ]; then tmp=$(mktemp) - echo "network={ - ssid=\"$essid\" - psk=\"$key\" - key_mgmt=WPA-EAP WPA-PSK - proto=RSN WPA - pairwise=CCMP TKIP - }" >> $tmp - wpa_supplicant -i $iface -c "$tmp" -dd -B 2>&1 > /dev/null + echo -n "$key" | wpa_passphrase "$essid" >> $tmp + wpa_supplicant -i $iface -c "$tmp" -B 2>&1 > /dev/null rm $tmp fi # sdhcp wait forever if $iface have no IP address. Workaround this. - t=$(ifconfig wlan0 |grep inet: |cut -d: -f2 |cut -d' ' -f1) + t=$(ifconfig $iface |grep inet: |cut -d: -f2 |cut -d' ' -f1) [ -z $t ] && ifconfig $iface 192.168.0.2 sdhcp -d $iface >/dev/null