forked from ahurac/dotfiles
15 lines
374 B
Text
15 lines
374 B
Text
|
#!/bin/sh -e
|
||
|
|
||
|
if [ "$(whoami)" != root ]; then
|
||
|
exec sudo "$0" "$@"
|
||
|
fi
|
||
|
|
||
|
cd /var/lib/iwd
|
||
|
|
||
|
field='Connected network'
|
||
|
ssid=$(iwctl station wlan show | grep '^\s*'"${field}"'\s' | xargs | sed "s/^${field} //")
|
||
|
unset field
|
||
|
passphrase=$(awk -F = '($1 == "'"${1}"'") { print $2 }' "${ssid}.psk")
|
||
|
|
||
|
qrencode -s 1 -l H -o - "WIFI:T:WPA;S:${ssid};P:${passphrase};;" | catimg -H 0 -
|