From 6dadfe3f1fe39d748c4ffc3c0091e8bb58bd4e52 Mon Sep 17 00:00:00 2001 From: spiritLHLS <103393591+spiritLHLS@users.noreply.github.com> Date: Fri, 12 May 2023 10:21:09 +0800 Subject: [PATCH] Update install_pve.sh --- scripts/install_pve.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install_pve.sh b/scripts/install_pve.sh index 43997dd..e596648 100644 --- a/scripts/install_pve.sh +++ b/scripts/install_pve.sh @@ -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"