]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
No need for wait loop. check_link_down sleeps for specified time in 0.5s intervals.
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Tue, 18 May 2010 12:13:13 +0000 (12:13 +0000)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Tue, 18 May 2010 12:13:13 +0000 (12:13 +0000)
svn-id: @11476

sysconfig/network-scripts/ifup

index 80c98c2954fc0f29b13b73cc7c937eb1093a0cce..ba73dedcf6ceee2b8fe8e0dd566551f1cfec505c 100755 (executable)
@@ -123,16 +123,10 @@ if is_wireless_device "${DEVICE}"; then
 fi
 
 if is_yes "${WLAN_WPA}"; then
-       [ -z "$WLAN_WPA_WAIT_TIMEOUT" ] && WLAN_WPA_WAIT_TIMEOUT=15
        /usr/sbin/wpa_supplicant -D ${WLAN_WPA_DRIVER:-wext} -c ${WLAN_WPA_CONFIG:-/etc/wpa_supplicant.conf} -i ${DEVICE} ${WLAN_WPA_OPTIONS} -P "/var/run/wpa_supplicant-${DEVICE}.pid" -B
-       i=0
-       while [ "$i" -lt "$WLAN_WPA_WAIT_TIMEOUT" ]; do
-               i=$((i + 1))
-               # check_link_down sleeps for 0.5s
-               check_link_down ${DEVICE} 2
-               status=$?
-               [ "$status" = "1" ] && break
-       done
+       [ -z "$WLAN_WPA_WAIT_TIMEOUT" ] && WLAN_WPA_WAIT_TIMEOUT=15
+       # check_link_down sleeps for 0.5s
+       check_link_down ${DEVICE} $(( $WLAN_WPA_WAIT_TIMEOUT * 2 ))
 fi
 
 if [ "$HANDLING" = "2" ]; then
This page took 0.344117 seconds and 4 git commands to generate.