Diff for /loncom/loncron between versions 1.122 and 1.124

version 1.122, 2020/05/06 13:34:22 version 1.124, 2020/05/09 19:17:33
Line 46  use GDBM_File; Line 46  use GDBM_File;
 use Storable qw(thaw);  use Storable qw(thaw);
 use File::ReadBackwards;  use File::ReadBackwards;
 use File::Copy;  use File::Copy;
   use Sys::Hostname::FQDN();
   
 #globals  #globals
 use vars qw (%perlvar %simplestatus $errors $warnings $notices $totalcount);  use vars qw (%perlvar %simplestatus $errors $warnings $notices $totalcount);
   
Line 540  sub clean_balanceIDs { Line 542  sub clean_balanceIDs {
     my $cleaned=0;      my $cleaned=0;
     my $active=0;      my $active=0;
     if (-d $perlvar{'lonBalanceDir'}) {      if (-d $perlvar{'lonBalanceDir'}) {
         while (my $fname=<$perlvar{'balanceDir'}/*.id>) {          while (my $fname=<$perlvar{'lonBalanceDir'}/*.id>) {
             my ($dev,$ino,$mode,$nlink,              my ($dev,$ino,$mode,$nlink,
                 $uid,$gid,$rdev,$size,                  $uid,$gid,$rdev,$size,
                 $atime,$mtime,$ctime,                  $atime,$mtime,$ctime,
Line 1564  sub main () { Line 1566  sub main () {
     if ('{[[[[lonHostID]]]]}' eq $perlvar{'lonHostID'}) {      if ('{[[[[lonHostID]]]]}' eq $perlvar{'lonHostID'}) {
  print("Unconfigured machine.\n");   print("Unconfigured machine.\n");
  my $emailto=$perlvar{'lonSysEMail'};   my $emailto=$perlvar{'lonSysEMail'};
  my $hostname=`/bin/hostname`;   my $hostname = Sys::Hostname::FQDN::fqdn();
  chop $hostname;   $hostname=~s/\.+/./g;
  $hostname=~s/[^\w\.]//g; # make sure is safe to pass through shell   $hostname=~s/\-+/-/g;
    $hostname=~s/[^\w\.-]//g; # make sure is safe to pass through shell
  my $subj="LON: Unconfigured machine $hostname";   my $subj="LON: Unconfigured machine $hostname";
  system("echo 'Unconfigured machine $hostname.' |".   system("echo 'Unconfigured machine $hostname.' |".
                " mail -s '$subj' $emailto > /dev/null");                 " mail -s '$subj' $emailto > /dev/null");

Removed from v.1.122  
changed lines
  Added in v.1.124


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>