[bin/qrwifi] Don't search passwords in other networks' sections
This commit is contained in:
parent
83c1fd88d8
commit
652d261ee9
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;/\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; }')"
|
||||
fi
|
||||
if [ -z "$pw" ]; then
|
||||
echo "Couldn't find password for network \`$ssid\`"
|
||||
|
|
Loading…
Reference in a new issue