From: Adam Osuchowski Date: Sat, 23 Dec 2017 12:30:02 +0000 (+0100) Subject: - add support for CHECK_LINK_WAIT_TIMEOUT config variable (wait max x sec for interfa... X-Git-Tag: 0.4.17~5 X-Git-Url: http://git.pld-linux.org/?p=projects%2Frc-scripts.git;a=commitdiff_plain;h=f71a1391f8819a26e9ace72406402c2bc96c8a9e - add support for CHECK_LINK_WAIT_TIMEOUT config variable (wait max x sec for interface link up) --- diff --git a/lib/ifup b/lib/ifup index b0c03f57..dee4e58b 100755 --- a/lib/ifup +++ b/lib/ifup @@ -176,7 +176,8 @@ if [ -n "$BOOTPROTO" -a "$BOOTPROTO" != "none" -a "$BOOTPROTO" != "static" ]; th fi DHCP_ARGS="$DHCP_OPTIONS $DHCP_ARGS" - if check_link_down ${DEVICE}; then + [ -z "$CHECK_LINK_WAIT_TIMEOUT" ] && CHECK_LINK_WAIT_TIMEOUT=5 + if check_link_down ${DEVICE} $(( $CHECK_LINK_WAIT_TIMEOUT * 2 )); then run_cmd "$(nls 'Determining IP information for %s (%s)' "$DEVICE" "${DHCP_CLIENT##*/}")" /bin/false nls '%s: Check cable/radio on-off switch?' "$DEVICE" exit 1 diff --git a/sysconfig/interfaces/ifcfg-description b/sysconfig/interfaces/ifcfg-description index 1629ce0d..45d5a704 100644 --- a/sysconfig/interfaces/ifcfg-description +++ b/sysconfig/interfaces/ifcfg-description @@ -81,6 +81,8 @@ VLAN_REORDER_HDR=[0|1] When this is set, the VLAN device will move the [ HANDLING=0|1|2|3 ] (0 is default; used ie. in ATM configuration, for details see ifup script) +[ CHECK_LINK_WAIT_TIMEOUT= ] + if DEVICE=eth*; then [ MEDIA={auto|10baseT|10base2|AUI} ]