From 3290e48c06a93f4e2a8d86153499f9075322dced Mon Sep 17 00:00:00 2001 From: bin456789 Date: Thu, 21 Sep 2023 00:12:26 +0800 Subject: [PATCH] =?UTF-8?q?core:=20=E6=9C=89=20dhcpv6=20=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E5=B0=B1=E4=B8=8D=E7=AD=89=E5=BE=85=20slaac?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- alpine-network.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/alpine-network.sh b/alpine-network.sh index ac5e96d..8d68f4f 100644 --- a/alpine-network.sh +++ b/alpine-network.sh @@ -47,15 +47,17 @@ get_ipv4_entry && dhcpv4=true || dhcpv4=false # dhcpv4 肯定是 /128 get_ipv6_entry | grep /128 && dhcpv6=true || dhcpv6=false -# 检测是否有 slaac -# 也可以有地址就行,不管是slaac或者dhcpv6 +# 等待slaac +# 有ipv6地址就跳过,不管是slaac或者dhcpv6 # 因为会在trans里判断 slaac=false -for i in $(seq 10 -1 0); do - echo "waiting slaac for ${i}s" - get_ipv6_entry | grep -v /128 && slaac=true && break - sleep 1 -done +if ! get_ipv6_entry; then + for i in $(seq 10 -1 0); do + echo "waiting slaac for ${i}s" + get_ipv6_entry | grep -v /128 && slaac=true && break + sleep 1 + done +fi # 设置静态地址 if ! is_have_ipv4 && [ -n "$ipv4_addr" ]; then