[bin/qrwifi] Take only first password
This commit is contained in:
parent
652d261ee9
commit
f622651482
1 changed files with 1 additions and 1 deletions
|
@ -11,7 +11,7 @@ fi
|
|||
|
||||
pw="${2:-}"
|
||||
if [ -z "$pw" ]; then
|
||||
pw="$(sudo cat /etc/wpa_supplicant/wpa_supplicant.conf | sed -n '/^[\t ]*ssid="'"$ssid"'"$/{:findpsk;N;/}/d;/\n[\t ]*psk=/!b findpsk;s/^\(\n\|.\)*[\t ]*psk="\(.*\)"$/\2/p; }')"
|
||||
pw="$(sudo cat /etc/wpa_supplicant/wpa_supplicant.conf | sed -n '/^[\t ]*ssid="'"$ssid"'"$/{:findpsk;N;/}/d;/\n[\t ]*psk=/!b findpsk;s/^\(\n\|.\)*[\t ]*psk="\([^"]*\)"$/\2/p; t quit}; d; :quit; q')"
|
||||
fi
|
||||
if [ -z "$pw" ]; then
|
||||
echo "Couldn't find password for network \`$ssid\`"
|
||||
|
|
Loading…
Reference in a new issue