summaryrefslogtreecommitdiffstats
path: root/src/connections/ethernet-iproute
diff options
context:
space:
mode:
Diffstat (limited to 'src/connections/ethernet-iproute')
-rw-r--r--src/connections/ethernet-iproute16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/connections/ethernet-iproute b/src/connections/ethernet-iproute
index a960e1d..bb6b152 100644
--- a/src/connections/ethernet-iproute
+++ b/src/connections/ethernet-iproute
@@ -18,11 +18,19 @@ ethernet_up() {
fi
fi
- if ip link show $INTERFACE|grep -q "NO-CARRIER"; then
- error "No connection available"
- fi
+ ip link set $INTERFACE up
+
+ 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
- ip link set $INTERFACE up
if checkyesno ${AUTH8021X:-no}; then
. ${SUBR_DIR}/8021x