File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,8 @@ if [ "$CHECK" -gt 0 ] || [ "$DISABLED" = '1' ]; then
121
121
echo "node is online"
122
122
LOOP=1
123
123
# check status for all physical devices
124
- for HOSTAPD in $(ls /var/run/hostapd-phy*); do
124
+ for HOSTAPD in /var/run/hostapd-phy*; do
125
+ [ -e "$HOSTAPD" ] || break # handle the case of no hostapd-phy* files
125
126
ONLINE_SSID="$(echo $ONLINE_SSIDs | awk -F ' ~' -v l=$((LOOP*2)) ' {print $l }' )"
126
127
LOOP=$((LOOP+1))
127
128
CURRENT_SSID="$(grep "^ssid=$ONLINE_SSID" $HOSTAPD | cut -d"=" -f2)"
@@ -165,7 +166,8 @@ elif [ "$CHECK" -eq 0 ]; then
165
166
if [ $OFF_COUNT -ge $(($T / 2)) ]; then
166
167
# node was offline more times than half of switch_timeframe (or than $FIRST)
167
168
LOOP=1
168
- for HOSTAPD in $(ls /var/run/hostapd-phy*); do
169
+ for HOSTAPD in /var/run/hostapd-phy*; do
170
+ [ -e "$HOSTAPD" ] || break # handle the case of no hostapd-phy* files
169
171
ONLINE_SSID="$(echo $ONLINE_SSIDs | awk -F ' ~' -v l=$((LOOP*2)) ' {print $l }' )"
170
172
LOOP=$((LOOP+1))
171
173
CURRENT_SSID="$(grep "^ssid=$OFFLINE_SSID" $HOSTAPD | cut -d"=" -f2)"
You can’t perform that action at this time.
0 commit comments