From 060ccf1051e259d1ce180498bd9f32a20da4bbc9 Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Wed, 6 May 2020 08:00:45 -0700 Subject: [PATCH 1/5] gui-cmd: Retry starting automated test if system is currently busy. --- lf_gui_cmd.pl | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/lf_gui_cmd.pl b/lf_gui_cmd.pl index 5079ed81..f2172818 100755 --- a/lf_gui_cmd.pl +++ b/lf_gui_cmd.pl @@ -125,20 +125,36 @@ if ($scenario ne "") { } if ($ttype ne "") { - print doCmd("cv create '$ttype' '$tname'"); + # Try several times in case system is currently busy cleaning up or similar. + my $i; + my $rslt; + for ($i = 0; $i<60; $i++) { + $rslt = doCmd("cv create '$ttype' '$tname'"); + print $rslt; + if ($rslt =~ /BUSY/) { + sleep(1); + } + else { + last; + } + } if ($tconfig ne "") { print doCmd("cv load '$tname' '$tconfig'"); } print doCmd("cv click '$tname' 'Auto Save Report'"); - my $i; for ($i = 0; $i<@modifiers_key; $i++) { my $k = $modifiers_key[$i]; my $v = $modifiers_val[$i]; print doCmd("cv set '$tname' '$k' '$v'"); } - print doCmd("cv click '$tname' 'Start'"); + $rslt = doCmd("cv click '$tname' 'Start'"); + print $rslt; + if ($rslt =~ /Could not find instance/) { + exit(1); + } + while (1) { my $rslt = doCmd("cv get '$tname' 'Report Location:'"); #print "Result-:$rslt:-\n"; From 0867751610fd8da8297e7f8589eed736fde8c67f Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Wed, 6 May 2020 14:33:05 -0700 Subject: [PATCH 2/5] adjust_apache: retrofits adjust_apache to handle manged /etc/hosts file --- adjust_apache.pl | 154 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 127 insertions(+), 27 deletions(-) diff --git a/adjust_apache.pl b/adjust_apache.pl index 56bf347e..49dfadd2 100755 --- a/adjust_apache.pl +++ b/adjust_apache.pl @@ -5,8 +5,8 @@ use warnings; use diagnostics; use Carp; use Data::Dumper; - - +my $Q='"'; +my $q="'"; my @idhunks = split(' ', `id`); my @hunks = grep { /uid=/ } @idhunks; die ("Must be root to use this") @@ -50,6 +50,7 @@ die ("No ip found for mgt_dev; your config.values file is out of date: $!") print "ip: $ip\n"; # This must be kept in sync with similar code in lf_kinstall. +my $found_localhost = 0; my $fname = "/etc/hosts"; if (-f "$fname") { my @lines = `cat $fname`; @@ -59,41 +60,140 @@ if (-f "$fname") { chomp(@lines); # we want to consolidate the $ip $hostname entry for MgrHostname my @newlines = (); - my %more_hostnames = ("lanforge-srv" => 1); + my %more_hostnames = (); my $new_entry = "$ip "; - my $blank = 0; - my $was_blank = 0; - + #my $blank = 0; + #my $was_blank = 0; + my $counter = 0; + #my $found_defaultip = 0; + my %address_map = ( + "127.0.0.1" => "localhost.localdomain localhost localhost4.localdomain4 localhost4", + "::1" => "localhost.localdomain localhost localhost6.loaldomain6 localhost6", + $ip => $MgrHostname, + "192.168.1.101" => "lanforge.localnet lanforge.localdomain", + ); + print Dumper(\%address_map); for my $ln (@lines) { - $was_blank = $blank; - $blank = ($ln =~ /^\s*$/) ? 1 : 0; - next if ($blank && $was_blank); - next if ($ln =~/^$ip $MgrHostname$/); + print "LN[$ln]\n"; + next if ($ln =~ /^\s*$/); + next if ($ln =~ /^127.0.0.1\b/); + next if ($ln =~ /^::1\b/); + next if ($ln =~ /^$ip\s+$MgrHostname\b/); next if ($ln =~ /^###-LF-HOSTAME-NEXT-###/); # old typo next if ($ln =~ /^###-LF-HOSTNAME-NEXT-###/); - if ($ln =~ /\b($MgrHostname|lanforge-srv|$ip)\b/) { - print "Matching LINE $ln\n"; - my @hunks = split(/\s+/, $ln); - for my $hunk (@hunks) { - #print "HUNK{$hunk} "; - next if ($hunk =~ /^($ip|lanforge-srv|$MgrHostname)$/); - $more_hostnames{$hunk} = 1; - } - next; + + #$found_localhost++ if ($ln =~ /^127.0.0.1\s+localhost/); + #if ($ln =~ /\b$MgrHostname\b/ + # || $ln =~ /\blanforge-srv\b/ + # || $ln =~ /\b$ip\b/) { + # print "MANAGER LINE [$ln]\n"; + # my @hunks = split(/\s+/, $ln); + # for my $hunk (@hunks) { + # print "HUNK{$hunk} "; + # next if ($hunk =~ /\b(localhost)/); + # next if ($hunk =~ /\b$ip\b/); + # next if ($hunk =~ /\blanforge-srv\b/); + # next if ($hunk =~ /\b$MgrHostname\b/); + # if + # $address_map{$ip} .= " $hunk" if ($hunk =~ /[g-z.]+/); # could not be ipv6 or ipv4 + # $address_map{$hunk} .= " extra-$counter" if ($hunk =~ /^[0-9.]+\b/); + # $address_map{$hunk} .= " extra6-$counter" if ($hunk =~ /[0-9a-f]+[:]/); + # $counter++; + # } + # next; + #} + + + print "\nPARSING IPv4 ln[$ln]\n"; + @hunks = split(/\s+/, $ln); + my $middleip = 0; + my $counter2 = 0; + my $prevname = ""; + my $previp = ""; + for my $hunk (@hunks) { + print "ZUNK{$hunk} "; + next if ($hunk =~ /^localhost/); + next if ($hunk =~ /^192\.168\.1\.101/); + next if ($hunk =~ /^127\.0\.0\.1/); + next if ($hunk =~ /^::1\b/); + next if ($hunk =~ /^::1\b/); + next if ($hunk =~ /^$ip\b/); + next if ($hunk =~ /^lanforge-srv\b/); + next if ($hunk =~ /^$MgrHostname\b/); + next if ($hunk =~ /^lanforge\.local(domain|net)\b/); + + $counter2++; + if ($hunk =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/) { + print " IP4($hunk)"; + $previp = $hunk; + if ($counter2) { # we're not first item on line + $middleip++; + print "MIDDLE"; + } + else { + $address_map{$hunk} .= " extra-$counter2"; + print "+IP4"; + } + } + if (($hunk =~ /[G-Zg-z]+\.?/) || ($hunk =~ /^\D+\.?/)) { + print " notIP($hunk)"; + $prevname = $hunk; + if ($middleip) { + print " middle($previp)"; + $address_map{$previp} .= " $hunk"; + $prevname = $hunk; + } + else { + print " more($hunk)"; + $more_hostnames{$hunk} = 1 ; # could not be ipv6 or ipv4, nutty stuff at start of line + } + } + elsif ($hunk =~ /^[0-9.]+\b/) { + print " hunk($hunk)prev($prevname)"; + $address_map{$hunk} .= " $prevname extra-$counter2" ; + $previp = $hunk; + next; + } + elsif ($hunk =~ /[0-9a-f]+[:]/) { + print " hunk6($hunk)"; + $address_map{$hunk} .= " extra6-$counter2"; + $previp = $hunk; + } } - print "ok ln[$ln]\n"; - push(@newlines, $ln); + + } # ~foreach line + + for my $name (sort keys %more_hostnames) { + $address_map{$ip} .=" $name"; + print "NEWSTUFF $ip $address_map{$ip}\n"; + } + + print Dumper(\%address_map); + + unshift(@newlines, "192.168.1.101 ".$address_map{"192.168.1.101"}); + unshift(@newlines, "127.0.0.1 ".$address_map{"127.0.0.1"}); + unshift(@newlines, "::1 ".$address_map{"::1"}); + + delete($address_map{"192.168.1.101"}); + delete($address_map{"127.0.0.1"}); + delete($address_map{"::1"}); + + for my $key (sort keys %address_map){ + next if ($key eq $ip); + push(@newlines, $key." ".$address_map{$key}); } push(@newlines, "###-LF-HOSTNAME-NEXT-###"); - + push(@newlines, $ip." ".$address_map{$ip}); + print Dumper(\@newlines); + sleep 5; for my $ln (@newlines) { print FILE "$ln\n"; } - print FILE "$ip $MgrHostname"; - for my $name (keys %more_hostnames) { - print FILE " $name"; - } + #print FILE "$ip $MgrHostname"; + #for my $name (keys %more_hostnames) { + # print FILE " $name"; + #} print FILE "\n\n"; close FILE; } @@ -163,7 +263,7 @@ foreach my $file (@places_to_check) { } push(@newlines, "# modified by lanforge\n") if ($edited == 0); - my $fh; + my $fh; die ($!) unless open($fh, ">", $file); print $fh join("\n", @newlines); close $fh; From 3d7217ffa0c1b38fa5f8de2c8adcb3a54d3996bc Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Wed, 6 May 2020 15:39:42 -0700 Subject: [PATCH 3/5] adjust_apache: retrofits adjust_apache to handle manged /etc/hosts file --- adjust_apache.pl | 117 ++++++++++++++++++++++++----------------------- 1 file changed, 61 insertions(+), 56 deletions(-) diff --git a/adjust_apache.pl b/adjust_apache.pl index 49dfadd2..465b00ea 100755 --- a/adjust_apache.pl +++ b/adjust_apache.pl @@ -74,68 +74,59 @@ if (-f "$fname") { ); print Dumper(\%address_map); for my $ln (@lines) { - print "LN[$ln]\n"; + print "\nLN[$ln]\n"; next if ($ln =~ /^\s*$/); - next if ($ln =~ /^127.0.0.1\b/); - next if ($ln =~ /^::1\b/); - next if ($ln =~ /^$ip\s+$MgrHostname\b/); next if ($ln =~ /^###-LF-HOSTAME-NEXT-###/); # old typo next if ($ln =~ /^###-LF-HOSTNAME-NEXT-###/); - #$found_localhost++ if ($ln =~ /^127.0.0.1\s+localhost/); - #if ($ln =~ /\b$MgrHostname\b/ - # || $ln =~ /\blanforge-srv\b/ - # || $ln =~ /\b$ip\b/) { - # print "MANAGER LINE [$ln]\n"; - # my @hunks = split(/\s+/, $ln); - # for my $hunk (@hunks) { - # print "HUNK{$hunk} "; - # next if ($hunk =~ /\b(localhost)/); - # next if ($hunk =~ /\b$ip\b/); - # next if ($hunk =~ /\blanforge-srv\b/); - # next if ($hunk =~ /\b$MgrHostname\b/); - # if - # $address_map{$ip} .= " $hunk" if ($hunk =~ /[g-z.]+/); # could not be ipv6 or ipv4 - # $address_map{$hunk} .= " extra-$counter" if ($hunk =~ /^[0-9.]+\b/); - # $address_map{$hunk} .= " extra6-$counter" if ($hunk =~ /[0-9a-f]+[:]/); - # $counter++; - # } - # next; - #} - - print "\nPARSING IPv4 ln[$ln]\n"; @hunks = split(/\s+/, $ln); my $middleip = 0; - my $counter2 = 0; + my $counter2 = -1; my $prevname = ""; my $previp = ""; + my $linehasip = 0; + my $lfhostname = 0; for my $hunk (@hunks) { - print "ZUNK{$hunk} "; - next if ($hunk =~ /^localhost/); - next if ($hunk =~ /^192\.168\.1\.101/); - next if ($hunk =~ /^127\.0\.0\.1/); - next if ($hunk =~ /^::1\b/); - next if ($hunk =~ /^::1\b/); - next if ($hunk =~ /^$ip\b/); - next if ($hunk =~ /^lanforge-srv\b/); - next if ($hunk =~ /^$MgrHostname\b/); - next if ($hunk =~ /^lanforge\.local(domain|net)\b/); - + print "\n ZUNK",$counter2,"-:$hunk:- "; $counter2++; + next if ($hunk =~ /^localhost/); + next if ($hunk =~ /^lanforge-srv\b/); + next if ($hunk =~ /^lanforge\.local(domain|net)\b/); + next if ($hunk =~ /^extra6?-\d+/); + + if (($hunk =~ /^$ip\b/) + || ($hunk =~ /^$MgrHostname\b/) + ){ + $linehasip++; + $lfhostname++; + $prevname = $hunk; + } + + if (($hunk =~ /^127\.0\.0\.1/) + || ($hunk =~ /^192\.168\.1\.101/) + || ($hunk =~ /^::1\b/) + ){ + $previp = $hunk; + $linehasip++; + } + if ($hunk =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/) { + $linehasip++; print " IP4($hunk)"; $previp = $hunk; - if ($counter2) { # we're not first item on line - $middleip++; + if ($counter2 > 0) { # we're not first item on line + $middleip++ if ($counter2 > 0); print "MIDDLE"; } - else { - $address_map{$hunk} .= " extra-$counter2"; - print "+IP4"; + + if (!(defined $address_map{$hunk})) { + $address_map{$hunk} = ""; } + print "+IP4"; + $previp = $hunk; } - if (($hunk =~ /[G-Zg-z]+\.?/) || ($hunk =~ /^\D+\.?/)) { + elsif (($hunk =~ /[G-Zg-z]+\.?/) || ($hunk =~ /^[^:A-Fa-f0-9]+/)) { print " notIP($hunk)"; $prevname = $hunk; if ($middleip) { @@ -143,23 +134,37 @@ if (-f "$fname") { $address_map{$previp} .= " $hunk"; $prevname = $hunk; } - else { - print " more($hunk)"; - $more_hostnames{$hunk} = 1 ; # could not be ipv6 or ipv4, nutty stuff at start of line + elsif ($linehasip) { + print " prev($previp $hunk)"; + $address_map{$previp} .= " $hunk"; + } + elsif ($lfhostname) { + $more_hostnames{$hunk} = 1; + } + else { # strange word + print " hunk($hunk) has no IP***"; + $more_hostnames{$hunk} = 1; } } - elsif ($hunk =~ /^[0-9.]+\b/) { - print " hunk($hunk)prev($prevname)"; - $address_map{$hunk} .= " $prevname extra-$counter2" ; - $previp = $hunk; - next; - } - elsif ($hunk =~ /[0-9a-f]+[:]/) { + elsif (($hunk =~ /::/) + || ($hunk =~ /[0-9A-Fa-f]+:/)) { print " hunk6($hunk)"; - $address_map{$hunk} .= " extra6-$counter2"; + $linehasip++; + if (!(defined $address_map{$hunk})) { + $address_map{$hunk} = ""; + } $previp = $hunk; } - } + elsif ($hunk =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/) { + print " hunk($hunk)prev($prevname)"; + $address_map{$hunk} .= " $prevname" ; + $previp = $hunk; + } + else { # is hostname and not an ip + $address_map{$previp} .= " $hunk"; + } + + } # ~foreach hunk } # ~foreach line From 48caf7e8cf964a482b4a5af3c98515509448ab6c Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Wed, 6 May 2020 15:54:41 -0700 Subject: [PATCH 4/5] adjust_apache: handles linebreaks and linejoins more logically --- adjust_apache.pl | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/adjust_apache.pl b/adjust_apache.pl index 465b00ea..63d768cf 100755 --- a/adjust_apache.pl +++ b/adjust_apache.pl @@ -73,18 +73,19 @@ if (-f "$fname") { "192.168.1.101" => "lanforge.localnet lanforge.localdomain", ); print Dumper(\%address_map); + my $prevname = ""; + my $previp = ""; + for my $ln (@lines) { print "\nLN[$ln]\n"; next if ($ln =~ /^\s*$/); next if ($ln =~ /^###-LF-HOSTAME-NEXT-###/); # old typo next if ($ln =~ /^###-LF-HOSTNAME-NEXT-###/); - print "\nPARSING IPv4 ln[$ln]\n"; + print "PARSING IPv4 ln[$ln]\n"; @hunks = split(/\s+/, $ln); my $middleip = 0; my $counter2 = -1; - my $prevname = ""; - my $previp = ""; my $linehasip = 0; my $lfhostname = 0; for my $hunk (@hunks) { @@ -119,7 +120,6 @@ if (-f "$fname") { $middleip++ if ($counter2 > 0); print "MIDDLE"; } - if (!(defined $address_map{$hunk})) { $address_map{$hunk} = ""; } @@ -131,19 +131,26 @@ if (-f "$fname") { $prevname = $hunk; if ($middleip) { print " middle($previp)"; - $address_map{$previp} .= " $hunk"; + $address_map{$previp} .= " $hunk" + if ($address_map{$previp} !~ /\b$hunk\b/); $prevname = $hunk; } elsif ($linehasip) { print " prev($previp $hunk)"; - $address_map{$previp} .= " $hunk"; + $address_map{$previp} .= " $hunk" + if ($address_map{$previp} !~ /\b$hunk\b/); } elsif ($lfhostname) { $more_hostnames{$hunk} = 1; } else { # strange word print " hunk($hunk) has no IP***"; - $more_hostnames{$hunk} = 1; + if ("" eq $previp) { + $more_hostnames{$hunk} = 1; + } + elsif ($address_map{$previp} !~ /\b$hunk\b/) { + $address_map{$previp} .= " $hunk" + } } } elsif (($hunk =~ /::/) @@ -157,10 +164,11 @@ if (-f "$fname") { } elsif ($hunk =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/) { print " hunk($hunk)prev($prevname)"; - $address_map{$hunk} .= " $prevname" ; + $address_map{$hunk} .= " $prevname" + if ($address_map{$hunk} !~ /\b$prevname\b/); $previp = $hunk; } - else { # is hostname and not an ip + elsif ($address_map{$previp} !~ /\b$hunk\b/) { # is hostname and not an ip $address_map{$previp} .= " $hunk"; } From 56e84cbbc44131c77b84b2efe0149811a9a80bc6 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Wed, 6 May 2020 16:00:36 -0700 Subject: [PATCH 5/5] adjust_apache: quieter now --- adjust_apache.pl | 50 +++++++++++++++++++++--------------------------- 1 file changed, 22 insertions(+), 28 deletions(-) diff --git a/adjust_apache.pl b/adjust_apache.pl index 63d768cf..ebfb5d5c 100755 --- a/adjust_apache.pl +++ b/adjust_apache.pl @@ -65,31 +65,31 @@ if (-f "$fname") { #my $blank = 0; #my $was_blank = 0; my $counter = 0; - #my $found_defaultip = 0; + my $debug = 0; my %address_map = ( "127.0.0.1" => "localhost.localdomain localhost localhost4.localdomain4 localhost4", "::1" => "localhost.localdomain localhost localhost6.loaldomain6 localhost6", $ip => $MgrHostname, "192.168.1.101" => "lanforge.localnet lanforge.localdomain", ); - print Dumper(\%address_map); + print Dumper(\%address_map) if ($debug); my $prevname = ""; my $previp = ""; for my $ln (@lines) { - print "\nLN[$ln]\n"; + print "\nLN[$ln]\n" if ($debug); next if ($ln =~ /^\s*$/); next if ($ln =~ /^###-LF-HOSTAME-NEXT-###/); # old typo next if ($ln =~ /^###-LF-HOSTNAME-NEXT-###/); - print "PARSING IPv4 ln[$ln]\n"; + print "PARSING IPv4 ln[$ln]\n" if ($debug); @hunks = split(/\s+/, $ln); my $middleip = 0; my $counter2 = -1; my $linehasip = 0; my $lfhostname = 0; for my $hunk (@hunks) { - print "\n ZUNK",$counter2,"-:$hunk:- "; + print "\n HUNK",$counter2,"-:$hunk:- " if ($debug); $counter2++; next if ($hunk =~ /^localhost/); next if ($hunk =~ /^lanforge-srv\b/); @@ -97,8 +97,7 @@ if (-f "$fname") { next if ($hunk =~ /^extra6?-\d+/); if (($hunk =~ /^$ip\b/) - || ($hunk =~ /^$MgrHostname\b/) - ){ + || ($hunk =~ /^$MgrHostname\b/)){ $linehasip++; $lfhostname++; $prevname = $hunk; @@ -106,37 +105,36 @@ if (-f "$fname") { if (($hunk =~ /^127\.0\.0\.1/) || ($hunk =~ /^192\.168\.1\.101/) - || ($hunk =~ /^::1\b/) - ){ + || ($hunk =~ /^::1\b/)){ $previp = $hunk; $linehasip++; } if ($hunk =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/) { $linehasip++; - print " IP4($hunk)"; + print " IP4($hunk)" if ($debug); $previp = $hunk; if ($counter2 > 0) { # we're not first item on line $middleip++ if ($counter2 > 0); - print "MIDDLE"; + print "middle" if ($debug); } if (!(defined $address_map{$hunk})) { $address_map{$hunk} = ""; } - print "+IP4"; + print "+IP4" if ($debug); $previp = $hunk; } elsif (($hunk =~ /[G-Zg-z]+\.?/) || ($hunk =~ /^[^:A-Fa-f0-9]+/)) { - print " notIP($hunk)"; + print " notIP($hunk)" if ($debug); $prevname = $hunk; if ($middleip) { - print " middle($previp)"; + print " middle($previp)" if ($debug); $address_map{$previp} .= " $hunk" if ($address_map{$previp} !~ /\b$hunk\b/); $prevname = $hunk; } elsif ($linehasip) { - print " prev($previp $hunk)"; + print " prev($previp $hunk)" if ($debug); $address_map{$previp} .= " $hunk" if ($address_map{$previp} !~ /\b$hunk\b/); } @@ -144,8 +142,8 @@ if (-f "$fname") { $more_hostnames{$hunk} = 1; } else { # strange word - print " hunk($hunk) has no IP***"; if ("" eq $previp) { + print " hunk($hunk) has no IP***" if ($debug); $more_hostnames{$hunk} = 1; } elsif ($address_map{$previp} !~ /\b$hunk\b/) { @@ -155,7 +153,7 @@ if (-f "$fname") { } elsif (($hunk =~ /::/) || ($hunk =~ /[0-9A-Fa-f]+:/)) { - print " hunk6($hunk)"; + print " hunk6($hunk)" if ($debug); $linehasip++; if (!(defined $address_map{$hunk})) { $address_map{$hunk} = ""; @@ -163,7 +161,7 @@ if (-f "$fname") { $previp = $hunk; } elsif ($hunk =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/) { - print " hunk($hunk)prev($prevname)"; + print " hunk($hunk)prev($prevname)" if ($debug); $address_map{$hunk} .= " $prevname" if ($address_map{$hunk} !~ /\b$prevname\b/); $previp = $hunk; @@ -177,11 +175,11 @@ if (-f "$fname") { } # ~foreach line for my $name (sort keys %more_hostnames) { - $address_map{$ip} .=" $name"; - print "NEWSTUFF $ip $address_map{$ip}\n"; + $address_map{$ip} .= " $name"; + print "NEWSTUFF $ip $address_map{$ip}\n" if ($debug); } - print Dumper(\%address_map); + print Dumper(\%address_map) if ($debug); unshift(@newlines, "192.168.1.101 ".$address_map{"192.168.1.101"}); unshift(@newlines, "127.0.0.1 ".$address_map{"127.0.0.1"}); @@ -197,17 +195,13 @@ if (-f "$fname") { } push(@newlines, "###-LF-HOSTNAME-NEXT-###"); push(@newlines, $ip." ".$address_map{$ip}); - print Dumper(\@newlines); - sleep 5; + print Dumper(\@newlines) if ($debug); + sleep 5 if ($debug); for my $ln (@newlines) { print FILE "$ln\n"; } - #print FILE "$ip $MgrHostname"; - #for my $name (keys %more_hostnames) { - # print FILE " $name"; - #} - print FILE "\n\n"; + print FILE "\n"; close FILE; }