diff options
author | James Rayner <james@rayner.id.au> | 2010-11-21 03:23:51 +0100 |
---|---|---|
committer | James Rayner <james@rayner.id.au> | 2010-11-21 03:23:51 +0100 |
commit | b96b428d9ff44d3e007a2b81113390c734f2323d (patch) | |
tree | ed76df4507a870adbcbe541d97f27d38c318d270 /src/8021x | |
parent | 6b43b99662e82534388b34258e140374a439dccf (diff) | |
download | netctl-b96b428d9ff44d3e007a2b81113390c734f2323d.tar.gz netctl-b96b428d9ff44d3e007a2b81113390c734f2323d.tar.xz |
FS#20150 - 802.11x: correct state check, handle disconnect
Diffstat (limited to 'src/8021x')
-rw-r--r-- | src/8021x | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -2,7 +2,8 @@ # wpa_check interface [timeout] wpa_check() { - local timeout=0 INTERFACE="$1" TIMEOUT="${2:-15}" + local timeout=0 INTERFACE="$1" TIMEOUT="${2:-15}" CONDITION="${3:-COMPLETED}" + # CONDITION is required as wired connections are ready at ASSOCIATED not COMPLETED FS#20150 while [[ $timeout -lt "$TIMEOUT" ]]; do ( # Sometimes wpa_supplicant isn't ready so silence errors for 2s only to avoid hiding real errors @@ -11,7 +12,7 @@ wpa_check() else eval $(wpa_cli -i "$INTERFACE" status | fgrep "wpa_state=") fi - [[ "$wpa_state" = "COMPLETED" ]] + [[ "$wpa_state" = "$CONDITION" ]] ) && return 0 sleep 1 let timeout++ |