Update install_pve.sh

This commit is contained in:
spiritLHLS 2023-05-12 10:21:09 +08:00 committed by GitHub
parent bf501e2ed8
commit 6dadfe3f1f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -79,8 +79,8 @@ check_cdn_file
# /etc/hosts文件修改
if [ -f "/etc/cloud/cloud.cfg" ]; then
if grep -q "preserve_hostname: false" "/etc/cloud/cloud.cfg"; then
sed -i 's/preserve_hostname: false/preserve_hostname: true/g' "/etc/cloud/cloud.cfg"
if grep -q "preserve_hostname" "/etc/cloud/cloud.cfg"; then
sed -E -i 's/preserve_hostname:[[:space:]]*false/preserve_hostname: true/g' "/etc/cloud/cloud.cfg"
echo "change preserve_hostname to true"
else
echo "preserve_hostname is true"