while: do if [ -f /proc/net/route ];then PUB_NIC=$(ip route get ...) ... break else sleep 1 fi done
unnecessary.
Thanks, Yinsi
Thanks, Dewan
Signed-off-by: Liu Yinsi liuyinsi@163.com
lib/bootstrap.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/lib/bootstrap.sh b/lib/bootstrap.sh index b04ea3dd4..2969544a6 100755 --- a/lib/bootstrap.sh +++ b/lib/bootstrap.sh @@ -91,8 +91,8 @@ network_ok() for i in /sys/class/net/*/ do [ "${i#*/lo/}" != "$i" ] && continue
[ "$(cat $i/operstate)" = 'up' ] && return 0
[ "$(cat $i/carrier 2>/dev/null)" = '1' ] && return 0
[ "$(cat $i/operstate)" = 'up' ] && export_ip_mac && return 0
[ "$(cat $i/carrier 2>/dev/null)" = '1' ] && export_ip_mac && return 0
done
is_clearlinux && {
@@ -296,6 +296,8 @@ export_ip_mac() export PUB_IP=$(ifconfig $PUB_NIC | awk '/inet / {print $2}') fi
- [ -n "$PUB_NIC" ] || return 1
- export PUB_MAC=$(cat /sys/class/net/$PUB_NIC/address) [ -n "$SCHED_HOST" ] && PUB_MAC=$(echo "$PUB_MAC" | tr : -)
} @@ -746,7 +748,6 @@ boot_init()
setup_network run_ntpdate
export_ip_mac
announce_bootup
-- 2.23.0