scripts/bash/wifiqr.bash

21 lines
520 B
Bash
Raw Normal View History

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