From db6e493a2d1e15c81306c61903303bc5119a21d0 Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Thu, 4 Jul 2024 20:12:29 +0200 Subject: [PATCH] tree: bugfix III Signed-off-by: AuxXxilium --- files/initrd/opt/arc/boot.sh | 8 ++++---- files/initrd/opt/arc/init.sh | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/files/initrd/opt/arc/boot.sh b/files/initrd/opt/arc/boot.sh index f9192ea0..ab162b0f 100755 --- a/files/initrd/opt/arc/boot.sh +++ b/files/initrd/opt/arc/boot.sh @@ -226,8 +226,8 @@ function bootDSM () { COUNT=0 DRIVER=$(ls -ld /sys/class/net/${ETH}/device/driver 2>/dev/null | awk -F '/' '{print $NF}') while true; do - if ! ip link show ${ETH} 2>/dev/null | grep -q 'UP'; then - echo -e "\r\033[1;37m${DRIVER}:\033[0m DOWN" + if ethtool ${ETH} 2>/dev/null | grep 'Link detected' | grep -q 'no'; then + echo -e "\r\033[1;37m${DRIVER}:\033[0m NOT CONNECTED" break fi COUNT=$((${COUNT} + 1)) @@ -242,8 +242,8 @@ function bootDSM () { fi break fi - if ethtool ${ETH} 2>/dev/null | grep 'Link detected' | grep -q 'no'; then - echo -e "\r\033[1;37m${DRIVER}:\033[0m NOT CONNECTED" + if ! ip link show ${ETH} 2>/dev/null | grep -q 'UP'; then + echo -e "\r\033[1;37m${DRIVER}:\033[0m DOWN" break fi if [ ${COUNT} -ge ${BOOTIPWAIT} ]; then diff --git a/files/initrd/opt/arc/init.sh b/files/initrd/opt/arc/init.sh index 64e892e9..2cb038d6 100755 --- a/files/initrd/opt/arc/init.sh +++ b/files/initrd/opt/arc/init.sh @@ -173,8 +173,8 @@ for ETH in ${ETHX}; do COUNT=0 DRIVER=$(ls -ld /sys/class/net/${ETH}/device/driver 2>/dev/null | awk -F '/' '{print $NF}') while true; do - if ! ip link show ${ETH} 2>/dev/null | grep -q 'UP'; then - echo -e "\r\033[1;37m${DRIVER}:\033[0m DOWN" + if ethtool ${ETH} 2>/dev/null | grep 'Link detected' | grep -q 'no'; then + echo -e "\r\033[1;37m${DRIVER}:\033[0m NOT CONNECTED" break fi COUNT=$((${COUNT} + 1)) @@ -188,8 +188,8 @@ for ETH in ${ETHX}; do fi break fi - if ethtool ${ETH} 2>/dev/null | grep 'Link detected' | grep -q 'no'; then - echo -e "\r\033[1;37m${DRIVER}:\033[0m NOT CONNECTED" + if ! ip link show ${ETH} 2>/dev/null | grep -q 'UP'; then + echo -e "\r\033[1;37m${DRIVER}:\033[0m DOWN" break fi if [ ${COUNT} -ge ${BOOTIPWAIT} ]; then