From b6ca413bfbfcaf3a06cf4ea3460ce46f44c78d15 Mon Sep 17 00:00:00 2001 From: spiritLHLS <103393591+spiritLHLS@users.noreply.github.com> Date: Mon, 13 Feb 2023 22:57:18 +0800 Subject: [PATCH] Update install_pve7.sh --- install_pve7.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/install_pve7.sh b/install_pve7.sh index 477f852..416a8f8 100644 --- a/install_pve7.sh +++ b/install_pve7.sh @@ -29,9 +29,10 @@ file_path="/etc/hosts" while read line; do if [[ "$line" =~ ^127\.0\.0\.1.* ]]; then host=($(echo "$line" | awk '{print $2, $3, $4}')) - host2="127.0.0.1 ${host[1]}" - host3="127.0.0.1 ${host[2]}" + host2="127.0.0.1 ${host[0]}" + host3="127.0.0.1 ${host[1]}" sed -i "s/$line/$host2\n$host3/g" $file_path + break fi done < $file_path hostname=$(cat /etc/hostname) @@ -54,6 +55,7 @@ if [ -e "/etc/cloud/templates/hosts.debian.tmpl" ]; then host2="127.0.0.1 ${host[1]}" host3="127.0.0.1 ${host[2]}" sed -i "s/$line/$host2\n$host3/g" $file_path + break fi done < $file_path hostname=$(cat /etc/hostname)