From 2f40d9375375b9820648d5ae46a60c7f06af1ccc Mon Sep 17 00:00:00 2001 From: James Rayner Date: Sat, 6 Jun 2009 12:10:05 +1000 Subject: Another attempt at a working link check, FS#13334 --- src/connections/ethernet | 15 +++++---------- src/connections/ethernet-iproute | 16 +++++----------- 2 files changed, 10 insertions(+), 21 deletions(-) (limited to 'src/connections') diff --git a/src/connections/ethernet b/src/connections/ethernet index 6ac3b65..e24e9f5 100644 --- a/src/connections/ethernet +++ b/src/connections/ethernet @@ -12,17 +12,12 @@ ethernet_up() { fi ip link set $INTERFACE up + sleep 1 - let timeout=0 - until ip link show $INTERFACE|grep -q "state UP" - do - sleep 0.5 - let timeout++ - if [[ $timeout -eq 5 ]]; then - err_append "No connection" - return 1 - fi - done + if ip link show $INTERFACE|grep -q "NO-CARRIER"; then + err_append "No connection" + return 1 + fi if checkyesno "${AUTH8021X:-no}"; then . "${SUBR_DIR}"/8021x diff --git a/src/connections/ethernet-iproute b/src/connections/ethernet-iproute index bb6b152..1a4a6e4 100644 --- a/src/connections/ethernet-iproute +++ b/src/connections/ethernet-iproute @@ -19,18 +19,12 @@ ethernet_up() { fi ip link set $INTERFACE up + sleep 1 - let timeout=0 - until ip link show $INTERFACE|grep -q "state UP" - do - sleep 0.5 - let timeout++ - if [[ $timeout -eq 5 ]]; then - error "No connection" - return 1 - fi - done - + if ip link show $INTERFACE|grep -q "NO-CARRIER"; then + err_append "No connection" + return 1 + fi if checkyesno ${AUTH8021X:-no}; then . ${SUBR_DIR}/8021x -- cgit v1.2.3-24-g4f1b