From: Silvio Rhatto Date: Fri, 1 Nov 2024 11:56:48 +0000 (-0300) Subject: Fix: avoid ambiguous matchings at kvmx_hostname X-Git-Tag: 0.4.0~3 X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=5132dfc5526f46ae3fe8daa179b3c9aeca934816;p=kvmx.git Fix: avoid ambiguous matchings at kvmx_hostname --- diff --git a/kvmx b/kvmx index 9574a99..f00d3f7 100755 --- 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 #######