Merge pull request #5 from RPi-Distro/master

configure unprotected wifi when WPA_PASSWORD is unset (#357)
pull/349/head
Holger Pandel 2019-12-09 11:57:51 +01:00 committed by GitHub
commit 2ca84fdbd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -142,7 +142,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`)

View File

@ -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