From f3490293ecd5b3c3df58f5ab2485a2f9d44a9b1d Mon Sep 17 00:00:00 2001 From: spiritlhl <103393591+spiritLHLS@users.noreply.github.com> Date: Fri, 23 Jun 2023 13:24:10 +0800 Subject: [PATCH] Update install_pve.sh --- scripts/install_pve.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/install_pve.sh b/scripts/install_pve.sh index 4934522..5b44782 100644 --- a/scripts/install_pve.sh +++ b/scripts/install_pve.sh @@ -1,7 +1,7 @@ #!/bin/bash # from # https://github.com/spiritLHLS/pve -# 2023.06.22 +# 2023.06.23 _red() { echo -e "\033[31m\033[01m$@\033[0m"; } @@ -101,10 +101,14 @@ fi if [[ -f "/etc/network/interfaces.new" && -f "/etc/network/interfaces" ]]; then chattr -i /etc/network/interfaces cp -f /etc/network/interfaces.new /etc/network/interfaces - sed -i '/source \/etc\/network\/interfaces\.d\/*/{s/^/#/}' "/etc/network/interfaces" - sed -i '/source \/etc\/network\/interfaces\.d\/*/{s/^/#/}' "/etc/network/interfaces.new" chattr +i /etc/network/interfaces fi +chattr -i /etc/network/interfaces +sed -i '/source \/etc\/network\/interfaces\.d\/*/{s/^/#/}' "/etc/network/interfaces" +chattr +i /etc/network/interfaces +chattr -i /etc/network/interfaces.new +sed -i '/source \/etc\/network\/interfaces\.d\/*/{s/^/#/}' "/etc/network/interfaces.new" +chattr +i /etc/network/interfaces.new # 合并文件 if [[ -f "/etc/network/interfaces.d/50-cloud-init" && -f "/etc/network/interfaces" ]]; then if [[ ! -f "/etc/network/interfaces" ]]; then @@ -538,4 +542,4 @@ _green "If the login is correct please do not rush to reboot the system, go to e _green "安装完毕,请打开HTTPS网页 $url" _green "用户名、密码就是服务器所使用的用户名、密码(如root和root用户的密码)" _green "如果登录无误请不要急着重启系统,去执行预配置环境的命令后再重启系统" -rm -rf /root/reboot_pve.txt \ No newline at end of file +rm -rf /root/reboot_pve.txt