]> gitweb.fluxo.info Git - kvmx.git/commitdiff
Fix: avoid ambiguous matchings at kvmx_hostname
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 1 Nov 2024 11:56:48 +0000 (08:56 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 1 Nov 2024 11:56:48 +0000 (08:56 -0300)
kvmx

diff --git a/kvmx b/kvmx
index 9574a9989a75b29cec4a9073ce617dc2f6e89cb3..f00d3f7ac217cdc17bbc4d8276a989d3aa6b1f80 100755 (executable)
--- a/kvmx
+++ b/kvmx
@@ -897,8 +897,8 @@ function kvmx_hostname {
 
   # Remove old hostname from hosts file
   if [ "\$OLD_HOST" != "$hostname.$domain" ]; then
-    if grep -q \$OLD_HOST /etc/hosts; then
-      sudo sed -i -e "/\$OLD_HOST/d" /etc/hosts 2> /dev/null
+    if grep -q " \$OLD_HOST "/etc/hosts; then
+      sudo sed -i -e "/ \$OLD_HOST /d" /etc/hosts 2> /dev/null
     fi
   fi
   ##### END REMOTE SCRIPT #######