aboutsummaryrefslogtreecommitdiffstats
path: root/network-scripts/network-functions
diff options
context:
space:
mode:
Diffstat (limited to 'network-scripts/network-functions')
-rw-r--r--network-scripts/network-functions11
1 files changed, 9 insertions, 2 deletions
diff --git a/network-scripts/network-functions b/network-scripts/network-functions
index 614ad2ca..5f6c72d4 100644
--- a/network-scripts/network-functions
+++ b/network-scripts/network-functions
@@ -453,11 +453,18 @@ check_device_down ()
fi
}
-check_link_down ()
+set_link_up ()
{
- if ! LC_ALL=C ip link show dev $1 2>/dev/null| grep -q ",UP" ; then
+ if [ "$LINKSTATUS" = down ]; then
ip link set dev $1 up >/dev/null 2>&1
+ else
+ grep -qsx 1 /sys/class/net/$1/carrier
fi
+}
+
+check_link_down ()
+{
+ set_link_up $1
timeout=0
delay=10
[ -n "$LINKDELAY" ] && delay=$(($LINKDELAY * 2))