Skip to content

Commit

Permalink
configure unprotected wifi when WPA_PASSWORD is unset (RPi-Distro#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdecker1201 authored and XECDesign committed Dec 5, 2019
1 parent 8bdbbfb commit 18c3ceb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`)

Expand Down
8 changes: 8 additions & 0 deletions stage2/02-net-tweaks/01-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 18c3ceb

Please sign in to comment.