diff options
author | Raphael Nestler <[email protected]> | 2020-09-18 15:40:33 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2020-09-18 14:40:33 +0100 |
commit | be8daaa7210d8a8df77792e7bcb3ec509d8e995e (patch) | |
tree | acc89ac834036a4eb11478659d30f338a8fd28e2 | |
parent | d6ee1e5469184e0a88c22e6c8f5d209350a34723 (diff) |
Only disable wifi if WPA_COUNTRY is not set (#416)
* 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.
-rwxr-xr-x | stage2/02-net-tweaks/01-run.sh | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/stage2/02-net-tweaks/01-run.sh b/stage2/02-net-tweaks/01-run.sh index 0929755..d82381b 100755 --- a/stage2/02-net-tweaks/01-run.sh +++ b/stage2/02-net-tweaks/01-run.sh @@ -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 |