From 8dfdce23e3f3b7ba1996cecd3968138050b5a2e1 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Sat, 4 Nov 2023 12:42:09 +0800 Subject: [PATCH] =?UTF-8?q?core:=20=E5=9C=A8=20windows=20=E4=B8=8B?= =?UTF-8?q?=E6=89=BE=E5=88=B0=20ip=20=E6=97=B6=E6=89=8D=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=BD=91=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reinstall.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reinstall.sh b/reinstall.sh index 0cd05b7..0a09fa7 100644 --- a/reinstall.sh +++ b/reinstall.sh @@ -808,9 +808,9 @@ collect_netconf() { # 网关 # shellcheck disable=SC2154 for gateway in "${gateways[@]}"; do - if [[ "$gateway" = *.* ]]; then + if [ -n "$ipv4_addr" ] && [[ "$gateway" = *.* ]]; then ipv4_gateway="$gateway" - elif [[ "$gateway" = *:* ]]; then + elif [ -n "$ipv6_addr" ] && [[ "$gateway" = *:* ]]; then ipv6_gateway="$gateway" fi done