Skip to content

Commit

Permalink
Wifi: retry 3x for getting stations
Browse files Browse the repository at this point in the history
  • Loading branch information
igorpecovnik committed Nov 30, 2024
1 parent ab67aa6 commit ba87a6f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tools/modules/network/network_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@ function network_config() {
ip link set ${adapter} up
default_wireless_network_config "${yamlfile}" "${adapter}"
LIST=()
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}'))
sleep 1
for i in {1..3}; do
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}'))
sleep 3
[[ "${#LIST[@]}" -gt 0 ]]; break
done
LIST_LENGTH=$((${#LIST[@]} / 2))
if [[ ${#LIST[@]} == 0 ]]; then
restore_netplan_config
Expand Down

0 comments on commit ba87a6f

Please sign in to comment.