Skip to content

Commit 2fd3b17

Browse files
authored
ffac-ssid-changer: add quotes to avoid interpret. (#46)
Fixing shellcheck errors: - SC2046: quote to prevent word splitting. - SC2061: quote so the shell won't interpret it. Co-authored-by: Grische <[email protected]>
1 parent 601cb60 commit 2fd3b17

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ffac-ssid-changer/shsrc/ssid-changer.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ safety_exit() {
1010
pgrep -f autoupdater >/dev/null && safety_exit 'autoupdater running'
1111
UT=$(sed 's/\..*//g' /proc/uptime)
1212
[ $UT -gt 60 ] || safety_exit 'less than one minute'
13-
[ $(find /var/run -name hostapd-phy* | wc -l) -gt 0 ] || safety_exit 'no hostapd-phy*'
13+
[ "$(find /var/run -name "hostapd-phy*" | wc -l)" -gt 0 ] || safety_exit 'no hostapd-phy*'
1414

1515
# only once every timeframe minutes the SSID will change to the Offline-SSID
1616
# (set to 1 minute to change immediately every time the router gets offline)
@@ -65,7 +65,7 @@ ONLINE_SSID_OWE="$(uci -q get wireless.owe_radio0.ssid)"
6565
[ -n "$ONLINE_SSID_OWE" ] && OWE=true || OWE=false
6666

6767
# get all SSIDs (replace \' with TICX and back to keep a possible tic in an SSID)
68-
ONLINE_SSIDs="$(uci show | grep wireless.client_radio[0-9]\. | grep ssid | awk -F '=' '{print $2}' | sed "s/\\\'/TICX/g" | tr \' \~ | sed "s/TICX/\\\'/g" ) "
68+
ONLINE_SSIDs="$(uci show | grep "wireless.client_radio[0-9]\." | grep ssid | awk -F '=' '{print $2}' | sed "s/\\\'/TICX/g" | tr \' \~ | sed "s/TICX/\\\'/g" ) "
6969
# if for whatever reason ONLINE_SSIDs is NULL:
7070
: ${ONLINE_SSIDs:="~FREIFUNK~"}
7171

0 commit comments

Comments
 (0)