Skip to content

Commit ba87a6f

Browse files
committed
Wifi: retry 3x for getting stations
1 parent ab67aa6 commit ba87a6f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tools/modules/network/network_config.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,11 @@ function network_config() {
5858
ip link set ${adapter} up
5959
default_wireless_network_config "${yamlfile}" "${adapter}"
6060
LIST=()
61-
LIST=($(iw dev ${adapter} scan 2> /dev/null | grep 'SSID\|^BSS' | cut -d" " -f2 | sed "s/(.*//g" | xargs -n2 -d'\n' | awk '{print $2,$1}'))
62-
sleep 1
61+
for i in {1..3}; do
62+
LIST=($(iw dev ${adapter} scan 2> /dev/null | grep 'SSID\|^BSS' | cut -d" " -f2 | sed "s/(.*//g" | xargs -n2 -d'\n' | awk '{print $2,$1}'))
63+
sleep 3
64+
[[ "${#LIST[@]}" -gt 0 ]]; break
65+
done
6366
LIST_LENGTH=$((${#LIST[@]} / 2))
6467
if [[ ${#LIST[@]} == 0 ]]; then
6568
restore_netplan_config

0 commit comments

Comments
 (0)