adjust_apache.pl: fixes printing more than one copy of the current management hostname

This was happening when a unit was getting moved between networks and a totally different IP was found for it

Signed-off-by: Jed Reynolds <jed@candelatech.com>
This commit is contained in:
Jed Reynolds
2021-04-05 17:02:30 -07:00
parent 8f8b50ecfe
commit 2be72140c9

View File

@@ -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;