fix wifi settings

This commit is contained in:
2024-03-29 03:45:47 +01:00
parent 8eb2d69e13
commit 9831046592
5 changed files with 128 additions and 121 deletions

8
scripts/addWifi.sh Normal file → Executable file
View File

@ -31,15 +31,21 @@ update_config=1
fi
# Validate arguments
if [ -z "$ssid" ] || [ -z "$psk" ]; then
if [ -z "$ssid" ]; then
echo "invalid-args"
exit 1
fi
key="WPA-PSK"
if [ -z "$psk" ]; then
key="NONE"
fi
echo "
network={
ssid=\"$ssid\"
psk=\"$psk\"
key_mgmt=\"$key\"
}
" | sudo tee -a "$file" >/dev/null