This commit is contained in:
spiritlhl 2023-08-11 02:33:00 +00:00
parent 46d7f8839a
commit d04267da26
6 changed files with 40 additions and 28 deletions

View file

@ -1,5 +1,11 @@
# 更新日志
2023.08.09
- 判断是否有IPV6网络如果没有则宿主机就不添加对应的V6的DNS
- 判断是否有IPV6网络如果没有则开设的虚拟机和容器就不添加对应的V6的DNS
- 修复带IPV6环境的容器设置ssh时需要重启容器才能保证容器内网络联通的问题自动判断是否需要自重启容器
2023.08.04
- 开设独立IPV4地址的虚拟机时尝试增加自动附加IPV6地址的功能

View file

@ -13,11 +13,9 @@
## 更新
2023.08.09
2023.08.11
- 判断是否有IPV6网络如果没有则宿主机就不添加对应的V6的DNS
- 判断是否有IPV6网络如果没有则开设的虚拟机和容器就不添加对应的V6的DNS
- 修复带IPV6环境的容器设置ssh时需要重启容器才能保证容器内网络联通的问题自动判断是否需要自重启容器
- 修复部分上次更新导致的新BUG测试无误了
[更新日志](CHANGELOG.md)

View file

@ -200,12 +200,14 @@ if [ -f /usr/local/bin/pve_check_ipv6 ]; then
part_1="${parts[0]}"
part_2="${parts[1]}"
IFS=":" read -ra part_1_parts <<< "$part_1"
part_1_last="${part_1_parts[-1]}"
if [ "$part_1_last" = "$vm_num" ]; then
ipv6_address=""
else
part_1_head=$(echo "$part_1" | awk -F':' 'BEGIN {OFS=":"} {last=""; for (i=1; i<NF; i++) {last=last $i ":"}; print last}')
ipv6_address="${part_1_head}${vm_num}"
if [ ! -z "${part_1_parts[@]}" ]; then
part_1_last="${part_1_parts[-1]}"
if [ "$part_1_last" = "$vm_num" ]; then
ipv6_address=""
else
part_1_head=$(echo "$part_1" | awk -F':' 'BEGIN {OFS=":"} {last=""; for (i=1; i<NF; i++) {last=last $i ":"}; print last}')
ipv6_address="${part_1_head}${vm_num}"
fi
fi
fi
if [ -f /usr/local/bin/pve_ipv6_prefixlen ]; then

View file

@ -195,12 +195,14 @@ if [ -f /usr/local/bin/pve_check_ipv6 ]; then
part_1="${parts[0]}"
part_2="${parts[1]}"
IFS=":" read -ra part_1_parts <<< "$part_1"
part_1_last="${part_1_parts[-1]}"
if [ "$part_1_last" = "$vm_num" ]; then
ipv6_address=""
else
part_1_head=$(echo "$part_1" | awk -F':' 'BEGIN {OFS=":"} {last=""; for (i=1; i<NF; i++) {last=last $i ":"}; print last}')
ipv6_address="${part_1_head}${vm_num}"
if [ ! -z "${part_1_parts[@]}" ]; then
part_1_last="${part_1_parts[-1]}"
if [ "$part_1_last" = "$vm_num" ]; then
ipv6_address=""
else
part_1_head=$(echo "$part_1" | awk -F':' 'BEGIN {OFS=":"} {last=""; for (i=1; i<NF; i++) {last=last $i ":"}; print last}')
ipv6_address="${part_1_head}${vm_num}"
fi
fi
fi
if [ -f /usr/local/bin/pve_ipv6_prefixlen ]; then

View file

@ -261,12 +261,14 @@ if [ -f /usr/local/bin/pve_check_ipv6 ]; then
part_1="${parts[0]}"
part_2="${parts[1]}"
IFS=":" read -ra part_1_parts <<< "$part_1"
part_1_last="${part_1_parts[-1]}"
if [ "$part_1_last" = "$vm_num" ]; then
ipv6_address=""
else
part_1_head=$(echo "$part_1" | awk -F':' 'BEGIN {OFS=":"} {last=""; for (i=1; i<NF; i++) {last=last $i ":"}; print last}')
ipv6_address="${part_1_head}${vm_num}"
if [ ! -z "${part_1_parts[@]}" ]; then
part_1_last="${part_1_parts[-1]}"
if [ "$part_1_last" = "$vm_num" ]; then
ipv6_address=""
else
part_1_head=$(echo "$part_1" | awk -F':' 'BEGIN {OFS=":"} {last=""; for (i=1; i<NF; i++) {last=last $i ":"}; print last}')
ipv6_address="${part_1_head}${vm_num}"
fi
fi
fi
if [ -f /usr/local/bin/pve_ipv6_prefixlen ]; then

View file

@ -203,12 +203,14 @@ if [ -f /usr/local/bin/pve_check_ipv6 ]; then
part_1="${parts[0]}"
part_2="${parts[1]}"
IFS=":" read -ra part_1_parts <<< "$part_1"
part_1_last="${part_1_parts[-1]}"
if [ "$part_1_last" = "$vm_num" ]; then
ipv6_address=""
else
part_1_head=$(echo "$part_1" | awk -F':' 'BEGIN {OFS=":"} {last=""; for (i=1; i<NF; i++) {last=last $i ":"}; print last}')
ipv6_address="${part_1_head}${vm_num}"
if [ ! -z "${part_1_parts[@]}" ]; then
part_1_last="${part_1_parts[-1]}"
if [ "$part_1_last" = "$vm_num" ]; then
ipv6_address=""
else
part_1_head=$(echo "$part_1" | awk -F':' 'BEGIN {OFS=":"} {last=""; for (i=1; i<NF; i++) {last=last $i ":"}; print last}')
ipv6_address="${part_1_head}${vm_num}"
fi
fi
fi
if [ -f /usr/local/bin/pve_ipv6_prefixlen ]; then