From 5f9be026909b4b101ab42e4b1475c1935296b5a5 Mon Sep 17 00:00:00 2001 From: spiritlhl <103393591+spiritLHLS@users.noreply.github.com> Date: Fri, 23 Jun 2023 14:49:36 +0000 Subject: [PATCH] Update --- scripts/build_nat_network.sh | 16 ++++++++-------- scripts/install_pve.sh | 3 +-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/scripts/build_nat_network.sh b/scripts/build_nat_network.sh index eeae3f0..7823560 100644 --- a/scripts/build_nat_network.sh +++ b/scripts/build_nat_network.sh @@ -179,11 +179,11 @@ if [ -f "/etc/network/interfaces.new" ];then chattr -i /etc/network/interfaces.new rm -rf /etc/network/interfaces.new fi -_green "Although the gateway has been set automatically, I am not sure if it has been applied successfully, please check in Datacenter-->pve-->System-->Network in PVE" -_green "If vmbr0 and vmbr1 are displayed properly and the Apply Configuration button is grayed out, there is no need to reboot" -_green "If the above scenario is different, click on the Apply Configuration button, wait a few minutes and reboot the system to ensure that the gateway has been successfully applied" -_green "after reboot may still show no change, but it does not matter, you test open a virtual machine or container to see if the actual network has been applied successfully" -_green "虽然已自动设置网关,但不确定是否已成功应用,请查看PVE中的 Datacenter-->pve-->System-->Network" -_green "如果 vmbr0 和 vmbr1 已正常显示且 Apply Configuration 这个按钮是灰色的,则不用执行 reboot 重启系统" -_green "上述情形如果有不同的,请点击 Apply Configuration 这个按钮,等待几分钟后重启系统,确保网关已成功应用" -_green "重启后可能显示依然没有改变,但没关系,你测试开一个虚拟机或者容器看看就知道是不是实际网络已应用成功了" +# _green "Although the gateway has been set automatically, I am not sure if it has been applied successfully, please check in Datacenter-->pve-->System-->Network in PVE" +# _green "If vmbr0 and vmbr1 are displayed properly and the Apply Configuration button is grayed out, there is no need to reboot" +# _green "If the above scenario is different, click on the Apply Configuration button, wait a few minutes and reboot the system to ensure that the gateway has been successfully applied" +_green "you can test open a virtual machine or container to see if the actual network has been applied successfully" +# _green "虽然已自动设置网关,但不确定是否已成功应用,请查看PVE中的 Datacenter-->pve-->System-->Network" +# _green "如果 vmbr0 和 vmbr1 已正常显示且 Apply Configuration 这个按钮是灰色的,则不用执行 reboot 重启系统" +# _green "上述情形如果有不同的,请点击 Apply Configuration 这个按钮,等待几分钟后重启系统,确保网关已成功应用" +_green "你可以测试开一个虚拟机或者容器看看就知道是不是实际网络已应用成功了" diff --git a/scripts/install_pve.sh b/scripts/install_pve.sh index d493b41..8200a3a 100644 --- a/scripts/install_pve.sh +++ b/scripts/install_pve.sh @@ -27,9 +27,8 @@ remove_duplicate_lines() { chattr -i "$1" # 去除重复行并跳过空行和注释行 if [ -f "$1" ]; then - awk '!/^ *#/ && NF { if (!x[$0]++) print }' "$1" > "$1.tmp" && mv -f "$1.tmp" "$1" + awk '!NF || !seen[$0]++' "$1" > "$1.tmp" && mv -f "$1.tmp" "$1" fi - rm -rf "$1.tmp" chattr +i "$1" }