Skip to content

Commit

Permalink
Only disable wifi if WPA_COUNTRY is not set (RPi-Distro#416)
Browse files Browse the repository at this point in the history
* Only disable wifi if WPA_COUNTRY is not set

* Use '-n' instead of '-v' to test if WPA_COUNTRY is set

Apparently -v doesn't work in all shells.
  • Loading branch information
rnestler committed Sep 18, 2020
1 parent d6ee1e5 commit be8daaa
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions stage2/02-net-tweaks/01-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ network={
EOL
fi

# Disable wifi on 5GHz models
# Disable wifi on 5GHz models if WPA_COUNTRY is not set
mkdir -p "${ROOTFS_DIR}/var/lib/systemd/rfkill/"
echo 1 > "${ROOTFS_DIR}/var/lib/systemd/rfkill/platform-3f300000.mmcnr:wlan"
echo 1 > "${ROOTFS_DIR}/var/lib/systemd/rfkill/platform-fe300000.mmcnr:wlan"
if [ -n "$WPA_COUNTRY" ]; then
echo 0 > "${ROOTFS_DIR}/var/lib/systemd/rfkill/platform-3f300000.mmcnr:wlan"
echo 0 > "${ROOTFS_DIR}/var/lib/systemd/rfkill/platform-fe300000.mmcnr:wlan"
else
echo 1 > "${ROOTFS_DIR}/var/lib/systemd/rfkill/platform-3f300000.mmcnr:wlan"
echo 1 > "${ROOTFS_DIR}/var/lib/systemd/rfkill/platform-fe300000.mmcnr:wlan"
fi

0 comments on commit be8daaa

Please sign in to comment.