diff options
author | Jouke Witteveen <j.witteveen@gmail.com> | 2012-06-21 12:19:53 +0200 |
---|---|---|
committer | Jouke Witteveen <j.witteveen@gmail.com> | 2012-06-21 12:19:53 +0200 |
commit | 5ac724b8d139b7e38c3a16c8752bad55076ea670 (patch) | |
tree | b7d5cdb68c5e050829aa6de401224284c0b482c0 /src/8021x | |
parent | 4e034777fa0bfffa11d87b602e6b2b941edd3262 (diff) | |
download | netctl-5ac724b8d139b7e38c3a16c8752bad55076ea670.tar.gz netctl-5ac724b8d139b7e38c3a16c8752bad55076ea670.tar.xz |
Introduce polling timeout logic
This should fix FS#30361 along the way.
Diffstat (limited to 'src/8021x')
-rw-r--r-- | src/8021x | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -130,7 +130,7 @@ list_networks() { } wpa_supplicant_scan_info() { - local INTERFACE="$1" fields="$2" spawned_wpa=0 essids scan_wait + local INTERFACE="$1" fields="$2" spawned_wpa=0 essids # temp file used, as keeping ESSID's with spaces in their name in arrays # is hard, obscure and kinda nasty. This is simpler and clearer. @@ -146,10 +146,7 @@ wpa_supplicant_scan_info() { # Wait at least 3 seconds for scan results sleep 3 # Sometimes, that is not enough (FS#29946) - for (( scan_wait = 3; scan_wait < 10; scan_wait++ )); do - wpa_cli -p "$WPA_CTRL_PATH" -i "$INTERFACE" status | grep -q "wpa_state=SCANNING" || break - sleep 1 - done + timeout_wait 7 '! wpa_cli -p "$WPA_CTRL_PATH" -i "$INTERFACE" status | grep -q "wpa_state=SCANNING"' wpa_cli -p "$WPA_CTRL_PATH" -i "$INTERFACE" scan_results | grep -v "^Selected" | grep -v "^bssid" | |