aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2002-12-17 17:45:38 +0000
committerBill Nottingham <notting@redhat.com>2002-12-17 17:45:38 +0000
commit5ea20a309fb11e31a8077e2bcf307291f7410f36 (patch)
tree7666955e79b862be524543ca6d107132bdc390d6 /sysconfig
parente6a4cb14e744f6f0170d1339974d7d581ee4351f (diff)
downloadinitscripts-5ea20a309fb11e31a8077e2bcf307291f7410f36.tar
initscripts-5ea20a309fb11e31a8077e2bcf307291f7410f36.tar.gz
initscripts-5ea20a309fb11e31a8077e2bcf307291f7410f36.tar.bz2
initscripts-5ea20a309fb11e31a8077e2bcf307291f7410f36.tar.xz
initscripts-5ea20a309fb11e31a8077e2bcf307291f7410f36.zip
more rhgb tweaks
have a loop for checking link state instead of a static 'sleep 5'
Diffstat (limited to 'sysconfig')
-rw-r--r--sysconfig/network-scripts/network-functions12
1 files changed, 9 insertions, 3 deletions
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index ad9e40d3..49d9cca5 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -131,9 +131,15 @@ check_device_down ()
check_link_down ()
{
if [ -x /sbin/mii-tool ]; then
- LC_ALL=C ip link show $1 2>/dev/null| grep -q UP || ip link set $1 up >/dev/null 2>&1
- # wait for link to come up
- sleep 5
+ if ! LC_ALL=C ip link show $1 2>/dev/null| grep -q UP ; then
+ ip link set $1 up >/dev/null 2>&1
+ timeout=0
+ while [ $timeout -le 10 ]; do
+ LC_ALL=C ip link show $1 2>/dev/null | grep -q UP && break
+ usleep 500000
+ timeout=$((timeout+1))
+ done
+ fi
/sbin/mii-tool $1 >/dev/null 2>&1 || return 1
output=`LC_ALL=C /sbin/mii-tool $1 2>&1`
if echo $output | grep -q "Operation not supported"; then