mirror of
https://github.com/bin456789/reinstall.git
synced 2025-01-18 20:39:14 +08:00
core: 修复 arch 作为原系统时无法记录 ipv6 信息
This commit is contained in:
parent
3bbe2c5446
commit
dd655a6db9
11
reinstall.sh
11
reinstall.sh
@ -2373,15 +2373,18 @@ collect_netconf() {
|
||||
# ip -6 route show default
|
||||
# default via 2602:1111:0:80::1 dev eth0 metric 1024 onlink pref medium
|
||||
|
||||
# arch + vultr
|
||||
# ip -6 route show default
|
||||
# default nhid 4011550343 via fe80::fc00:5ff:fe3d:2714 dev enp1s0 proto ra metric 1024 expires 1504sec pref medium
|
||||
|
||||
for v in 4 6; do
|
||||
if ethx=$(ip -$v route show default | awk '$4=="dev"' | head -1 | awk '{print $5}' | grep .); then
|
||||
if ip -$v route show default | awk '$5=="'$ethx'"' | head -1 | grep -q .; then
|
||||
if via_gateway_dev_ethx=$(ip -$v route show default | grep -Ewo 'via [^ ]+ dev [^ ]+' | head -1 | grep .); then
|
||||
read -r _ gateway _ ethx <<<"$via_gateway_dev_ethx"
|
||||
eval ipv${v}_ethx="$ethx" # can_use_cloud_kernel 要用
|
||||
eval ipv${v}_mac="$(ip link show dev $ethx | grep link/ether | head -1 | awk '{print $2}')"
|
||||
eval ipv${v}_gateway="$(ip -$v route show default | awk '$5=="'$ethx'"' | head -1 | awk '{print $3}')"
|
||||
eval ipv${v}_gateway="$gateway"
|
||||
eval ipv${v}_addr="$(ip -$v -o addr show scope global dev $ethx | grep -v temporary | head -1 | awk '{print $4}')"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user