diff options
| author | Sam Tygier <samtygier@yahoo.co.uk> | 2018-12-17 00:01:04 +0000 |
|---|---|---|
| committer | XECDesign <XECDesign@users.noreply.github.com> | 2018-12-21 04:09:47 +0000 |
| commit | f4dc2dcce6d1fa16fb9e235456ac8de0ae4e9501 (patch) | |
| tree | 37429b42cde58e44a7e6f7483cae6b870e8ca0a5 /stage2 | |
| parent | d07096ebb565bc9ac97974895c57d88b0e82ce23 (diff) | |
Allow setting up wifi from config
Add WPA_ESSID, WPA_PASSWORD and WPA_COUNTRY options to config.
Diffstat (limited to 'stage2')
| -rwxr-xr-x | stage2/02-net-tweaks/01-run.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/stage2/02-net-tweaks/01-run.sh b/stage2/02-net-tweaks/01-run.sh index d21419e..2192943 100755 --- a/stage2/02-net-tweaks/01-run.sh +++ b/stage2/02-net-tweaks/01-run.sh @@ -6,3 +6,14 @@ install -v -m 644 files/wait.conf "${ROOTFS_DIR}/etc/systemd/system/dhcpcd.serv install -v -d "${ROOTFS_DIR}/etc/wpa_supplicant" install -v -m 600 files/wpa_supplicant.conf "${ROOTFS_DIR}/etc/wpa_supplicant/" +if [ -v WPA_COUNTRY ] +then + echo "country=${WPA_COUNTRY}" >> "${ROOTFS_DIR}/etc/wpa_supplicant/wpa_supplicant.conf" +fi + +if [ -v WPA_ESSID -a -v WPA_PASSWORD ] +then +on_chroot <<EOF +wpa_passphrase ${WPA_ESSID} ${WPA_PASSWORD} >> "/etc/wpa_supplicant/wpa_supplicant.conf" +EOF +fi |
