2021-01-25 21:31:34 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Arguments: SSID and WPA2 (3 untested) passphrase
|
|
|
|
|
2021-02-18 18:43:15 +01:00
|
|
|
# -l H uses the highest error correction in case 30 % gets damaged (or artistried upon)
|
|
|
|
|
2023-02-01 18:40:31 +01:00
|
|
|
PIXELSIZE=6
|
|
|
|
|
2021-01-25 21:31:34 +01:00
|
|
|
# Outputs QR code to terminal
|
2021-02-18 18:43:15 +01:00
|
|
|
qrencode -l H -t utf8 "WIFI:T:WPA;S:$1;P:$2;;"
|
2021-01-25 21:31:34 +01:00
|
|
|
# Stores QR code as SSID.png, -s doubles pixel size from default 3
|
2023-02-01 18:40:31 +01:00
|
|
|
qrencode -l H -s $PIXELSIZE -o $1.png "WIFI:T:WPA;S:$1;P:$2;;"
|
2023-01-31 09:59:54 +01:00
|
|
|
# Might as well jpg this too
|
|
|
|
convert "$1".png "$1".jpg
|
|
|
|
|
2021-01-25 21:31:34 +01:00
|
|
|
|
|
|
|
# Prints details
|
|
|
|
echo "SSID: $1"
|
|
|
|
echo "Passphrase: $2"
|
|
|
|
echo "Stored as $1.png"
|