[LON-CAPA-cvs] cvs: loncom / loncron

raeburn raeburn at source.lon-capa.org
Sat Jan 11 17:37:19 EST 2020


raeburn		Sat Jan 11 22:37:19 2020 EDT

  Modified files:              
    /loncom	loncron 
  Log:
  - Format of header line for logged changes in IP address of hosts in network 
    is: | Hostname | Previous IP | New IP |
  
  
Index: loncom/loncron
diff -u loncom/loncron:1.120 loncom/loncron:1.121
--- loncom/loncron:1.120	Sat Jan 11 21:54:31 2020
+++ loncom/loncron	Sat Jan 11 22:37:19 2020
@@ -2,7 +2,7 @@
 
 # Housekeeping program, started by cron, loncontrol and loncron.pl
 #
-# $Id: loncron,v 1.120 2020/01/11 21:54:31 raeburn Exp $
+# $Id: loncron,v 1.121 2020/01/11 22:37:19 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1096,12 +1096,12 @@
     if (keys(%prevhosts) && keys(%currhosts)) {
         foreach my $key (keys(%prevhosts)) {
             unless ($currhosts{$key} eq $prevhosts{$key}) {
-                $ipchange{$key} = $prevhosts{$key}.' | '.$currhosts{$key}.' |';
+                $ipchange{$key} = $prevhosts{$key}.' | '.$currhosts{$key};
             }
         }
         foreach my $key (keys(%currhosts)) {
             unless ($currhosts{$key} eq $prevhosts{$key}) {
-                $ipchange{$key} = $prevhosts{$key}.' | '.$currhosts{$key}.' |';
+                $ipchange{$key} = $prevhosts{$key}.' | '.$currhosts{$key};
             }
         }
     }
@@ -1109,10 +1109,10 @@
         if (keys(%ipchange)) {
             if (open(my $fh,'>>',$perlvar{'lonDaemons'}.'/logs/hostip.log')) {
                print $fh "********************\n".localtime(time).' Changes --'."\n".
-                         "Hostname | Previous IP | New IP |\n".
-                         "--------------------------------\n";
+                         "| Hostname | Previous IP | New IP |\n".
+                         " --------------------------------- \n";
                foreach my $hostname (sort(keys(%ipchange))) {
-                    print $fh "$hostname | $ipchange{$hostname}\n";
+                    print $fh "| $hostname | $ipchange{$hostname} |\n";
                 }
                 print $fh "\n*******************\n\n";
                 close($fh);
@@ -1127,10 +1127,10 @@
                               "MIME-Version: 1.0\n\n".
                               "Host/IP changes\n".
                               " \n".
-                              "Hostname | Previous IP | New IP |\n".
-                              "--------------------------------\n";
+                              "| Hostname | Previous IP | New IP |\n".
+                              " --------------------------------- \n";
                 foreach my $hostname (sort(keys(%ipchange))) {
-                    $chgmail .= "$hostname | $ipchange{$hostname}\n";
+                    $chgmail .= "| $hostname | $ipchange{$hostname} |\n";
                 }
                 $chgmail .= "\n\n";
                 if (open(my $mailh, "|/usr/lib/sendmail -oi -t -odb")) {




More information about the LON-CAPA-cvs mailing list