From a7970838741c7fe57a473c6695ab7cadec04996e Mon Sep 17 00:00:00 2001 From: spiritlhl <103393591+spiritLHLS@users.noreply.github.com> Date: Thu, 22 Jun 2023 12:53:06 +0000 Subject: [PATCH] Update --- README.md | 3 ++- scripts/install_pve.sh | 40 ++++++++++++++++++++++++++++------------ 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index dcc7f59..fe3e009 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ 待开发内容: -- 部分机器ifudown2安装有问题,原因在于PVE的MAC地址自动绑定错误,待修复(比如HostHatch和Hetzner) +- 部分机器ifudown2安装有问题,原因在于PVE的MAC地址自动绑定错误,待修复(比如HostHatch) - 创建带IPV6独立地址的VM虚拟机或CT容器 - KVM模板加载部分自定义的限制,避免机器用于滥用发包 - 增加arm64架构的一键安装功能 @@ -17,6 +17,7 @@ - PVE安装修复部分机器网络设置不立即重新加载的问题,增加网络设置备份 - 部分机器的IPV6物理接口使用auto类型,无法安装PVE,修改为static类型并重写配置 - 由于上面这条修复,已支持在Linode平台安装PVE了 +- 修复低版本PVE还安装ifupdown2的问题,7.x以下版本使用ifupdown也足够了 [更新日志](CHANGELOG.md) diff --git a/scripts/install_pve.sh b/scripts/install_pve.sh index af18d1c..01c4466 100644 --- a/scripts/install_pve.sh +++ b/scripts/install_pve.sh @@ -448,18 +448,34 @@ apt-get update install_package sudo install_package iproute2 # ifupdown2 安装可能需要校验MAC地址,进行修复 -apt-get install -y ifupdown2 -if [ $? -ne 0 ]; then - if grep -q "hwaddress" /etc/network/interfaces; then - echo "hwaddress already defined in /etc/network/interfaces." - else - echo "Adding hwaddress to /etc/network/interfaces..." - echo "hwaddress $mac_address" >> /etc/network/interfaces - fi - echo "Reloading network configuration..." - ifdown -a && ifup -a - apt-get install -y ifupdown2 -fi +# if [ $? -ne 0 ]; then +# if grep -q "hwaddress" /etc/network/interfaces; then +# echo "hwaddress already defined in /etc/network/interfaces." +# else +# echo "Adding hwaddress to /etc/network/interfaces..." +# echo "hwaddress $mac_address" >> /etc/network/interfaces +# fi +# echo "Reloading network configuration..." +# ifdown -a && ifup -a +# apt-get install -y ifupdown2 +# fi +case $version in + stretch) + install_package ifupdown + ;; + buster) + install_package ifupdown + ;; + bullseye) + install_package ifupdown2 + ;; + bookworm) + install_package ifupdown2 + ;; + *) + exit 1 + ;; +esac install_package net-tools install_package novnc install_package cloud-init