diff options
author | James Rayner <james@archlinux.org> | 2008-12-18 07:12:51 +0100 |
---|---|---|
committer | James Rayner <james@archlinux.org> | 2008-12-18 07:12:51 +0100 |
commit | 41197e24cfe9d2bf040d411e6c438aff516d943f (patch) | |
tree | 715a9b41e30c9b9d3a97e9084db301ab81a40dd7 /src/8021x | |
parent | 07514350b8404670e14f764ef6b3a9114469621e (diff) | |
download | netctl-41197e24cfe9d2bf040d411e6c438aff516d943f.tar.gz netctl-41197e24cfe9d2bf040d411e6c438aff516d943f.tar.xz |
FS11818, improve key handling, use subshells to avoid scope issues after libify
Diffstat (limited to 'src/8021x')
-rw-r--r-- | src/8021x | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -5,8 +5,12 @@ wpa_check() local timeout=0 INTERFACE=$1 TIMEOUT=${2:-15} while [[ $timeout -lt $TIMEOUT ]]; do - ( - eval `wpa_cli status|grep wpa_state` + ( # Sometimes wpa_supplicant isn't ready so silence errors for 2s only to avoid hiding real errors + if [[ $timeout -lt 2 ]]; then + eval `wpa_cli status 2> /dev/null|grep wpa_state` + else + eval `wpa_cli status|grep wpa_state` + fi [[ "$wpa_state" = "COMPLETED" ]] ) && return 0 sleep 1 @@ -22,7 +26,7 @@ start_wpa() { INTERFACE="$1"; WPA_CONF="$2"; WPA_OPTS="$3" - wpa_supplicant -wB -P/var/run/wpa_supplicant_${INTERFACE}.pid -i"${INTERFACE}" -c "$WPA_CONF" $WPA_OPTS + wpa_supplicant -B -P/var/run/wpa_supplicant_${INTERFACE}.pid -i"${INTERFACE}" -c "$WPA_CONF" $WPA_OPTS sleep 1 if [[ ! -f "/var/run/wpa_supplicant_${INTERFACE}.pid" ]]; then |