Setup WiFi Client

Note

You may need to add the country= line to wpa_supplicant.conf yourself...

Or, place the wpa_supplicant.conf in the boot partition.

sed -re 's/^(country=).*$/\1GB/' -i /etc/wpa_supplicant/wpa_supplicant.conf
wpa_passphrase "${SSID}" "${PSK}" >> /etc/wpa_supplicant/wpa_supplicant.conf
wpa_cli -i wlan0 reconfigure