From b6db7980b6078e90aaf2e53ee6ebebe84cccb19c Mon Sep 17 00:00:00 2001 From: spiritlhl <103393591+spiritLHLS@users.noreply.github.com> Date: Wed, 24 May 2023 14:42:28 +0800 Subject: [PATCH] Update install_pve.sh --- scripts/install_pve.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/install_pve.sh b/scripts/install_pve.sh index 5897749..1964362 100644 --- a/scripts/install_pve.sh +++ b/scripts/install_pve.sh @@ -113,8 +113,11 @@ if [ "${hostname}" != "pve" ]; then else _blue "已存在 ${ip} ${hostname} ${hostname} 的记录,无需添加" fi + chattr -i /etc/hostname hostnamectl set-hostname pve + chattr +i /etc/hostname hostname=$(hostname) + chattr -i /etc/hosts if ! grep -q "::1 localhost" /etc/hosts; then echo "::1 localhost" >> /etc/hosts echo "Added ::1 localhost to /etc/hosts"