mirror of
https://gitea.blesmrt.net/mikaela/scripts.git
synced 2025-08-17 20:07:20 +02:00
Compare commits
5 Commits
90f6c3ee37
...
f81a0ca221
Author | SHA1 | Date | |
---|---|---|---|
f81a0ca221 | |||
8162696f55 | |||
4ea1bcdb40 | |||
2209ff5821 | |||
15e72f4d1a |
2
bash/.gitignore
vendored
2
bash/.gitignore
vendored
@ -1,2 +1,4 @@
|
|||||||
# wifiqr.bash output
|
# wifiqr.bash output
|
||||||
*.png
|
*.png
|
||||||
|
*.jpg
|
||||||
|
*.jpeg
|
||||||
|
@ -17,6 +17,22 @@ iwctl station $WIFIDEVICE get-networks
|
|||||||
# The manpage says: iwctl --passphrase=PASSPHRASE station DEVICE connect SSID
|
# The manpage says: iwctl --passphrase=PASSPHRASE station DEVICE connect SSID
|
||||||
# but considering it says -P is shorthand for passphrase, I think this should
|
# but considering it says -P is shorthand for passphrase, I think this should
|
||||||
# work too while being more logical in my opinion.
|
# work too while being more logical in my opinion.
|
||||||
echo "% sudo iwctl station $WIFIDEVICE connect \$SSID -P \$KEY"
|
echo "To connect:
|
||||||
|
% iwctl station $WIFIDEVICE connect \$SSID -P \$KEY
|
||||||
|
"
|
||||||
# For permanent connections https://gitea.blesmrt.net/mikaela/shell-things/src/branch/master/var/lib/iwd
|
# For permanent connections https://gitea.blesmrt.net/mikaela/shell-things/src/branch/master/var/lib/iwd
|
||||||
|
|
||||||
|
# Device Provisioning Protocol https://iwd.wiki.kernel.org/device_provisioning
|
||||||
|
# requires qrencode, so let's check it exists
|
||||||
|
if hash qrencode needrestart 2>/dev/null; then
|
||||||
|
# Remind of command to share
|
||||||
|
echo "To share credentials:
|
||||||
|
% iwctl dpp $WIFIDEVICE start-configurator
|
||||||
|
"
|
||||||
|
# It needs to be stopped too
|
||||||
|
echo "To stop sharing credentials:
|
||||||
|
% iwctl dpp $WIFIDEVICE stop"
|
||||||
|
# Remind me that this part exists if qrencode is not found.
|
||||||
|
else
|
||||||
|
echo "WARNING! qrencode not found."
|
||||||
|
fi
|
||||||
|
@ -3,14 +3,16 @@
|
|||||||
# Arguments: Name & content
|
# Arguments: Name & content
|
||||||
|
|
||||||
# -l H uses the highest error correction in case 30 % gets damaged (or artistried upon)
|
# -l H uses the highest error correction in case 30 % gets damaged (or artistried upon)
|
||||||
|
# -s 6 doubles the dot/pixel size
|
||||||
|
|
||||||
# Outputs QR code to terminal
|
# Outputs QR code to terminal
|
||||||
|
|
||||||
# ${@:2} takes all arguments except not the first one
|
# ${@:2} takes all arguments except not the first one
|
||||||
qrencode -l H -t utf8 "${@:2}"
|
qrencode -l H -t utf8 "${@:2}"
|
||||||
# Stores QR code as $1.png (first argument)
|
# Stores QR code as $1.png (first argument)
|
||||||
qrencode -l H -o "$1".png "${@:2}"
|
qrencode -s 6 -l H -o "$1".png "${@:2}"
|
||||||
|
# My stepfather wants jpg
|
||||||
|
convert "$1".png "$1".jpg
|
||||||
# Prints details
|
# Prints details
|
||||||
echo "Name: $1.png"
|
echo "Name: $1.png"
|
||||||
echo "Content: ${@:2}"
|
echo "Content: ${@:2}"
|
||||||
|
@ -8,6 +8,9 @@
|
|||||||
qrencode -l H -t utf8 "WIFI:T:WPA;S:$1;P:$2;;"
|
qrencode -l H -t utf8 "WIFI:T:WPA;S:$1;P:$2;;"
|
||||||
# Stores QR code as SSID.png, -s doubles pixel size from default 3
|
# Stores QR code as SSID.png, -s doubles pixel size from default 3
|
||||||
qrencode -l H -s 6 -o $1.png "WIFI:T:WPA;S:$1;P:$2;;"
|
qrencode -l H -s 6 -o $1.png "WIFI:T:WPA;S:$1;P:$2;;"
|
||||||
|
# Might as well jpg this too
|
||||||
|
convert "$1".png "$1".jpg
|
||||||
|
|
||||||
|
|
||||||
# Prints details
|
# Prints details
|
||||||
echo "SSID: $1"
|
echo "SSID: $1"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user