summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Decker <chrisdecker1201@users.noreply.github.com>2019-12-05 16:08:04 +0100
committerXECDesign <XECDesign@users.noreply.github.com>2019-12-05 15:08:04 +0000
commit18c3cebe94c99daf80dcdeaa8bc0f9202de3a943 (patch)
tree0b1ba808af51c6a8384d1d8d271e0169f13393f4
parent8bdbbfb099ecac884a901572d126b0fe47de5d95 (diff)
configure unprotected wifi when WPA_PASSWORD is unset (#357)
-rw-r--r--README.md2
-rwxr-xr-xstage2/02-net-tweaks/01-run.sh8
2 files changed, 9 insertions, 1 deletions
diff --git a/README.md b/README.md
index 83dd2ad..7ad31db 100644
--- a/README.md
+++ b/README.md
@@ -119,7 +119,7 @@ The following environment variables are supported:
* `WPA_ESSID`, `WPA_PASSWORD` and `WPA_COUNTRY` (Default: unset)
- If these are set, they are use to configure `wpa_supplicant.conf`, so that the raspberry pi can automatically connect to a wifi network on first boot.
+ If these are set, they are use to configure `wpa_supplicant.conf`, so that the raspberry pi can automatically connect to a wifi network on first boot. If `WPA_ESSID` is set and `WPA_PASSWORD` is unset an unprotected wifi network will be configured.
* `ENABLE_SSH` (Default: `0`)
diff --git a/stage2/02-net-tweaks/01-run.sh b/stage2/02-net-tweaks/01-run.sh
index 3ba2ef9..154e515 100755
--- a/stage2/02-net-tweaks/01-run.sh
+++ b/stage2/02-net-tweaks/01-run.sh
@@ -14,6 +14,14 @@ if [ -v WPA_ESSID ] && [ -v WPA_PASSWORD ]; then
on_chroot <<EOF
wpa_passphrase "${WPA_ESSID}" "${WPA_PASSWORD}" >> "/etc/wpa_supplicant/wpa_supplicant.conf"
EOF
+elif [ -v WPA_ESSID ]; then
+cat >> "${ROOTFS_DIR}/etc/wpa_supplicant/wpa_supplicant.conf" << EOL
+
+network={
+ ssid="${WPA_ESSID}"
+ key_mgmt=NONE
+}
+EOL
fi
# Disable wifi on 5GHz models