Update install_pve.sh

This commit is contained in:
spiritlhl 2023-05-24 14:42:28 +08:00 committed by GitHub
parent 7f63250e81
commit b6db7980b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -113,8 +113,11 @@ if [ "${hostname}" != "pve" ]; then
else else
_blue "已存在 ${ip} ${hostname} ${hostname} 的记录,无需添加" _blue "已存在 ${ip} ${hostname} ${hostname} 的记录,无需添加"
fi fi
chattr -i /etc/hostname
hostnamectl set-hostname pve hostnamectl set-hostname pve
chattr +i /etc/hostname
hostname=$(hostname) hostname=$(hostname)
chattr -i /etc/hosts
if ! grep -q "::1 localhost" /etc/hosts; then if ! grep -q "::1 localhost" /etc/hosts; then
echo "::1 localhost" >> /etc/hosts echo "::1 localhost" >> /etc/hosts
echo "Added ::1 localhost to /etc/hosts" echo "Added ::1 localhost to /etc/hosts"