Update install_pve.sh

This commit is contained in:
spiritlhl 2023-06-12 21:40:55 +08:00 committed by GitHub
parent 64153d5953
commit 6f0e319b38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -146,10 +146,10 @@ if [ "${hostname}" != "pve" ]; then
echo "::1 localhost" >> /etc/hosts
echo "Added ::1 localhost to /etc/hosts"
fi
# if grep -q "^127\.0\.0\.1 localhost$" /etc/hosts; then
# sed -i '/^127\.0\.0\.1 localhost$/ s/^/#/' /etc/hosts
# echo "Commented out 127.0.0.1 localhost in /etc/hosts"
# fi
if grep -q "^127\.0\.1\.1" /etc/hosts; then
sed -i '/^127\.0\.1\.1/s/^/#/' /etc/hosts
echo "Commented out lines starting with 127.0.1.1 in /etc/hosts"
fi
if ! grep -q "^127\.0\.0\.1 localhost\.localdomain localhost$" /etc/hosts; then
# 127.0.1.1
echo "${ip} ${hostname}.localdomain ${hostname}" >> /etc/hosts