diff options
author | Jan Macku <jamacku@redhat.com> | 2021-02-04 14:33:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-04 14:33:55 +0100 |
commit | b505d7373d12ee0be7be84dd1c85d999f7c556ba (patch) | |
tree | 006b100b24c25deb258a2bfba57b8c0a48e967b6 | |
parent | b458221290c9dbd01447eb298c6b75b41ebb3762 (diff) | |
download | initscripts-b505d7373d12ee0be7be84dd1c85d999f7c556ba.tar initscripts-b505d7373d12ee0be7be84dd1c85d999f7c556ba.tar.gz initscripts-b505d7373d12ee0be7be84dd1c85d999f7c556ba.tar.bz2 initscripts-b505d7373d12ee0be7be84dd1c85d999f7c556ba.tar.xz initscripts-b505d7373d12ee0be7be84dd1c85d999f7c556ba.zip |
network: fix condition in set_link_up()
Related: #1555001
(cherry picked from commit b0e3fcae2a609cf4e011c767e57b7128a6cd090d)
-rw-r--r-- | network-scripts/network-functions | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/network-scripts/network-functions b/network-scripts/network-functions index bc046f54..e318151d 100644 --- a/network-scripts/network-functions +++ b/network-scripts/network-functions @@ -455,14 +455,17 @@ check_device_down () set_link_up () { - if [ "$LINKSTATUS" != up ]; then + if [ "$LINKSTATUS" != down ]; then ip link set dev $1 up >/dev/null 2>&1 fi } check_link_down () { - set_link_up $1 + if ! LC_ALL=C ip link show dev $1 2>/dev/null| grep -q ",UP" ; then + set_link_up $1 + fi + timeout=0 delay=10 [ -n "$LINKDELAY" ] && delay=$(($LINKDELAY * 2)) |