mirror of
https://github.com/thelittlerocket/pve.git
synced 2025-03-04 01:38:12 +08:00
Update
This commit is contained in:
parent
5f9be02690
commit
6dcda7fb1e
2 changed files with 7 additions and 12 deletions
|
@ -11,11 +11,12 @@
|
||||||
|
|
||||||
## 更新
|
## 更新
|
||||||
|
|
||||||
2023.06.23
|
2023.06.24
|
||||||
|
|
||||||
- 网关配置修改使用新结构,以便于适配大多数机器
|
- 网关配置修改使用新结构,以便于适配大多数机器
|
||||||
- 调整安装的流程,升级软件包后需要重启一次系统,详见脚本的运行提示
|
- 调整安装的流程,升级软件包后需要重启一次系统,详见脚本的运行提示
|
||||||
- 解决了ifupdown2的安装问题,支持在更多商家的服务器上安装
|
- 解决了ifupdown2的安装问题,支持在更多商家的服务器上安装
|
||||||
|
- 修复部分机器是IPV6子网前缀识别失效的问题
|
||||||
|
|
||||||
[更新日志](CHANGELOG.md)
|
[更新日志](CHANGELOG.md)
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ ipv4_address=$(ip addr show | awk '/inet .*global/ && !/inet6/ {print $2}')
|
||||||
# 提取IPV4网关
|
# 提取IPV4网关
|
||||||
gateway=$(ip route | awk '/default/ {print $3}')
|
gateway=$(ip route | awk '/default/ {print $3}')
|
||||||
# 获取IPV6子网前缀
|
# 获取IPV6子网前缀
|
||||||
SUBNET_PREFIX=$(ip -6 addr show | grep -E 'inet6.*global' | awk '{print $2}' | awk -F'/' '{print $1}' | head -n 1 | cut -d ':' -f1-5):
|
SUBNET_PREFIX=$(ip -6 addr show | grep -E 'inet6.*global' | awk '{print $2}' | awk -F'/' '{print $1}' | head -n 1 | rev | cut -d ':' -f 2- | rev):
|
||||||
# 提取IPV6地址
|
# 提取IPV6地址
|
||||||
ipv6_address=$(ip addr show | awk '/inet6.*scope global/ { print $2 }' | head -n 1)
|
ipv6_address=$(ip addr show | awk '/inet6.*scope global/ { print $2 }' | head -n 1)
|
||||||
# 检查是否存在 IPV6
|
# 检查是否存在 IPV6
|
||||||
|
@ -85,7 +85,10 @@ if [[ -f "/etc/network/interfaces.d/50-cloud-init" && -f "/etc/network/interface
|
||||||
chattr +i /etc/network/interfaces.d/50-cloud-init
|
chattr +i /etc/network/interfaces.d/50-cloud-init
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
if [ -f "/etc/network/interfaces.new" ];then
|
||||||
|
chattr -i /etc/network/interfaces.new
|
||||||
rm -rf /etc/network/interfaces.new
|
rm -rf /etc/network/interfaces.new
|
||||||
|
fi
|
||||||
interfaces_file="/etc/network/interfaces"
|
interfaces_file="/etc/network/interfaces"
|
||||||
chattr -i "$interfaces_file"
|
chattr -i "$interfaces_file"
|
||||||
if ! grep -q "auto lo" "$interfaces_file"; then
|
if ! grep -q "auto lo" "$interfaces_file"; then
|
||||||
|
@ -98,15 +101,6 @@ if ! grep -q "iface lo inet loopback" "$interfaces_file"; then
|
||||||
echo "Can not find 'iface lo inet loopback' in ${interfaces_file}"
|
echo "Can not find 'iface lo inet loopback' in ${interfaces_file}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# if ! grep -q "iface ${interface} inet manual" "$interfaces_file"; then
|
|
||||||
# if grep -q "iface ${interface_2} inet manual" "$interfaces_file"; then
|
|
||||||
# interface=${interface_2}
|
|
||||||
# else
|
|
||||||
# # echo "iface ${interface} inet manual" >> "$interfaces_file"
|
|
||||||
# echo "Can not find 'iface ${interface} inet manual' in ${interfaces_file}"
|
|
||||||
# exit 1
|
|
||||||
# fi
|
|
||||||
# fi
|
|
||||||
if grep -q "vmbr0" "$interfaces_file"; then
|
if grep -q "vmbr0" "$interfaces_file"; then
|
||||||
echo "vmbr0 已存在在 ${interfaces_file}"
|
echo "vmbr0 已存在在 ${interfaces_file}"
|
||||||
echo "vmbr0 already exists in ${interfaces_file}"
|
echo "vmbr0 already exists in ${interfaces_file}"
|
||||||
|
|
Loading…
Reference in a new issue