summaryrefslogtreecommitdiff
path: root/bin/extra/zbar_wpa
diff options
context:
space:
mode:
authorRaymaekers Luca <luca@spacehb.net>2025-07-05 23:23:29 +0200
committerRaymaekers Luca <luca@spacehb.net>2025-07-05 23:23:29 +0200
commita7b12d1e391d505f94f77d2a92f0f00818d19582 (patch)
tree1d9ebbac4fd6cdfbfe737376612bfe7ab15cef37 /bin/extra/zbar_wpa
parent0de0f0922a2c3ce0246c99c8f6f276d06cf11531 (diff)
checkpoint
Diffstat (limited to 'bin/extra/zbar_wpa')
-rwxr-xr-xbin/extra/zbar_wpa13
1 files changed, 13 insertions, 0 deletions
diff --git a/bin/extra/zbar_wpa b/bin/extra/zbar_wpa
new file mode 100755
index 0000000..9aab318
--- /dev/null
+++ b/bin/extra/zbar_wpa
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+QR="$(zbarcam -q -1)"
+Wifi="${QR#*:*:*:}"
+AP="${Wifi%%;*}"
+Passphrase="${Wifi##*;P:}"
+Passphrase="${Passphrase%%;*}"
+
+wpa_passphrase "$AP" "$Passphrase"
+>&2 printf 'Continue ?'
+head -n 1
+
+wpa_passphrase "$AP" "$Passphrase" >> /etc/wpa_supplicant/wpa_supplicant.conf