diff --git a/adjust_apache.pl b/adjust_apache.pl index 3f233c64..d071b1f4 100755 --- a/adjust_apache.pl +++ b/adjust_apache.pl @@ -340,7 +340,9 @@ if (-f "$fname") { print "old[$ln]\n" if ($debug); # if we are comments or blank lines, preserve them next if ($ln =~ /LF-HOSTNAME-NEXT/); - next if ($ln =~ /^$host_map{$MgrHostname}\s+/); + next if ($ln =~ /\b$MgrHostname\b/); # skip our mgt hostname + next if ($ln =~ /^$host_map{$MgrHostname}\s+/); # line starts with present IP addr + if (($ln =~ /^\s*$/) || ($ln =~ /^\s*#/)) { push(@newlines, $ln); next;