Ajout : script qrconn
This commit is contained in:
parent
cd4fb8d3d9
commit
4f818076b7
1 changed files with 17 additions and 0 deletions
17
bin/qrconn
Executable file
17
bin/qrconn
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
if [ "$(whoami)" != root ]; then
|
||||
exec sudo "$0" "$@"
|
||||
fi
|
||||
|
||||
cd "/var/lib/connman/$(connmanctl services | head -n 1 | awk '{ print $NF }')"
|
||||
|
||||
get_var() {
|
||||
awk -F = '($1 == "'"${1}"'") { print $2 }' settings
|
||||
}
|
||||
|
||||
ssid="$(get_var Name)"
|
||||
psk="$(get_var Passphrase)"
|
||||
|
||||
qrencode -s 1 -l H -o - "WIFI:T:WPA;S:${ssid};P:${psk};;" | catimg -H 0 -
|
||||
|
Loading…
Reference in a new issue