mirror of
https://github.com/bin456789/reinstall.git
synced 2025-01-31 19:08:07 +08:00
core: 修复 windows 下未能记录 32 位 ipv4 掩码和 dhcpv6 ip
This commit is contained in:
parent
275a3fc36f
commit
1b9069272d
@ -781,7 +781,7 @@ collect_netconf() {
|
|||||||
ip=${ips[i]}
|
ip=${ips[i]}
|
||||||
subnet=${subnets[i]}
|
subnet=${subnets[i]}
|
||||||
if [[ "$ip" = *.* ]]; then
|
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"
|
ipv4_addr="$ip/$cidr"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
@ -794,8 +794,10 @@ collect_netconf() {
|
|||||||
cidr=${subnets[i]}
|
cidr=${subnets[i]}
|
||||||
if [[ "$ip" = *:* ]]; then
|
if [[ "$ip" = *:* ]]; then
|
||||||
ipv6_type=$(grep "$ip" <<<"$ipv6_type_list" | awk '{print $1}')
|
ipv6_type=$(grep "$ip" <<<"$ipv6_type_list" | awk '{print $1}')
|
||||||
|
# Public 是 slaac
|
||||||
# 还有类型 Temporary,不过有 Temporary 肯定还有 Public,因此不用
|
# 还有类型 Temporary,不过有 Temporary 肯定还有 Public,因此不用
|
||||||
if [ "$ipv6_type" = Public ] ||
|
if [ "$ipv6_type" = Public ] ||
|
||||||
|
[ "$ipv6_type" = Dhcp ] ||
|
||||||
[ "$ipv6_type" = Manual ]; then
|
[ "$ipv6_type" = Manual ]; then
|
||||||
ipv6_addr="$ip/$cidr"
|
ipv6_addr="$ip/$cidr"
|
||||||
break
|
break
|
||||||
|
Loading…
x
Reference in New Issue
Block a user