RPi-Distro / pi-gen

Tool used to create the official Raspberry Pi OS images
BSD 3-Clause "New" or "Revised" License
2.52k stars 1.58k forks source link

stage2/02-net-tweaks/01-run.sh #779

Closed AZincenco closed 3 weeks ago

AZincenco commented 3 weeks ago

Hello

The script stage2/02-net-tweaks/01-run.sh has a typo in line 6: if [ -v WPA_COUNTRY ]; then it should be if [ -v "${WPA_COUNTRY}" ]; then Hope it helps

XECDesign commented 3 weeks ago

From the documentation for bash:

   -v varname
         True if the shell variable varname is set (has been assigned a value).

Checking that it works as intended:

$ if [ -v TEST ]; then echo "TEST is set to $TEST"; else echo "TEST is unset"; fi
TEST is unset
$ TEST=something; if [ -v TEST ]; then echo "TEST is set to $TEST"; else echo "TEST is unset"; fi
TEST is set to something