From 1b9069272d23d1dc6e5716c9a54a6968dc30ba2a Mon Sep 17 00:00:00 2001 From: bin456789 Date: Sat, 4 Nov 2023 12:40:26 +0800 Subject: [PATCH] =?UTF-8?q?core:=20=E4=BF=AE=E5=A4=8D=20windows=20?= =?UTF-8?q?=E4=B8=8B=E6=9C=AA=E8=83=BD=E8=AE=B0=E5=BD=95=2032=20=E4=BD=8D?= =?UTF-8?q?=20ipv4=20=E6=8E=A9=E7=A0=81=E5=92=8C=20dhcpv6=20ip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reinstall.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reinstall.sh b/reinstall.sh index 586d376..0cd05b7 100644 --- a/reinstall.sh +++ b/reinstall.sh @@ -781,7 +781,7 @@ collect_netconf() { ip=${ips[i]} subnet=${subnets[i]} if [[ "$ip" = *.* ]]; then - cidr=$(ipcalc -b "$ip/$subnet" | grep Network: | cut -d/ -f2 | xargs) + cidr=$(ipcalc -b "$ip/$subnet" | grep Netmask: | awk '{print $NF}') ipv4_addr="$ip/$cidr" break fi @@ -794,8 +794,10 @@ collect_netconf() { cidr=${subnets[i]} if [[ "$ip" = *:* ]]; then ipv6_type=$(grep "$ip" <<<"$ipv6_type_list" | awk '{print $1}') + # Public 是 slaac # 还有类型 Temporary,不过有 Temporary 肯定还有 Public,因此不用 if [ "$ipv6_type" = Public ] || + [ "$ipv6_type" = Dhcp ] || [ "$ipv6_type" = Manual ]; then ipv6_addr="$ip/$cidr" break