From 8b41a0da60ed111defd0831f5c6396b154cf6d4d Mon Sep 17 00:00:00 2001 From: spiritLHLS <103393591+spiritLHLS@users.noreply.github.com> Date: Tue, 4 Apr 2023 19:24:17 +0800 Subject: [PATCH] Update install_pve.sh --- install_pve.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/install_pve.sh b/install_pve.sh index b18e217..cbc609f 100644 --- a/install_pve.sh +++ b/install_pve.sh @@ -233,6 +233,15 @@ then echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf > /dev/null chattr +i /etc/resolv.conf fi +if [ $? -ne 0 ]; then + if [ ! -f /etc/rc.local ]; then + echo "#!/bin/bash" | sudo tee /etc/rc.local > /dev/null + echo "echo \"nameserver 8.8.8.8\" > /etc/resolv.conf" | sudo tee -a /etc/rc.local > /dev/null + sudo chmod +x /etc/rc.local + fi +fi +systemctl enable rc-local.service +systemctl start rc-local.service # 打印安装后的信息 url="https://${ip}:8006/" _green "安装完毕,请打开HTTPS网页 $url"