version 1.10, 2002/11/04 02:53:07
|
version 1.13, 2002/12/18 14:37:45
|
Line 62 Scott Harrison, sharrison@users.sourcefo
|
Line 62 Scott Harrison, sharrison@users.sourcefo
|
|
|
=cut |
=cut |
|
|
|
# ' stupid emacs |
# ================================================== READ IN COMMAND ARGUMENTS. |
# ================================================== READ IN COMMAND ARGUMENTS. |
|
|
# ---------------------------------------------------- Process download option. |
# ---------------------------------------------------- Process download option. |
Line 195 SERVERLOOP: foreach my $serverpath (@ser
|
Line 196 SERVERLOOP: foreach my $serverpath (@ser
|
$FTPSERVER_noauth=~s/^.*?\@//; |
$FTPSERVER_noauth=~s/^.*?\@//; |
print($out |
print($out |
"Trying $FTPSERVER_noauth...\n"); # Notify of attempts with ip name. |
"Trying $FTPSERVER_noauth...\n"); # Notify of attempts with ip name. |
`ping -c 1 $FTPSERVER_noauth 2>/dev/null`; # Ping ftp server (you there?). |
`ping -c 1 -w 10 $FTPSERVER_noauth 2>/dev/null`;#Ping ftp server (u there?) |
if ($?==0) # If the ftp server can be pinged. |
if ($?==0) # If the ftp server can be pinged. |
{ |
{ |
print($out "$FTPSERVER found...\n"); # Tell user ftp server is found. |
print($out "$FTPSERVER found...\n"); # Tell user ftp server is found. |
Line 321 sub clean_exit
|
Line 322 sub clean_exit
|
if ($mode eq 'cronmail') # If cronmail mode, then mail LON-CAPA sys admin. |
if ($mode eq 'cronmail') # If cronmail mode, then mail LON-CAPA sys admin. |
{ |
{ |
close(FOUT); |
close(FOUT); |
|
|
# Read in configuration to get e-mail addresses. |
# Read in configuration to get e-mail addresses. |
my $perlvarref = read_conf('loncapa.conf'); |
my $perlvarref = read_conf('loncapa.conf'); |
my %perlvar = %{$perlvarref}; |
my %perlvar = %{$perlvarref}; |
Line 330 sub clean_exit
|
Line 332 sub clean_exit
|
|
|
# Set metadata for the e-mail. |
# Set metadata for the e-mail. |
my $emailto = "$perlvar{'lonAdmEMail'},$perlvar{'lonSysEMail'}"; |
my $emailto = "$perlvar{'lonAdmEMail'},$perlvar{'lonSysEMail'}"; |
# my $emailto = "sharrison\@users.sourceforge.net"; |
|
my $subj="LON: $perlvar{'lonHostID'}, RPMS to upgrade"; |
my $subj=$perlvar{'lonHostID'}.', RPMS to upgrade'; |
system( |
|
'metasend -b -t '.$emailto.' -s '. |
# Make the e-mail's subject header to describe whether up-to-date. |
"'$subj' -f /tmp/CHECKRPMS.$$ -m text/plain"); |
if ($reallygoodoutput) |
|
{ |
|
$subj = 'happy_lon: '.$subj; # Machine is up-to-date. |
|
} |
|
else |
|
{ |
|
$subj = 'ALERT_lon: '.$subj; # There are out-of-date RPMs. |
|
} |
|
|
|
# Send the e-mail. |
|
if (!$reallygoodoutput) |
|
{ |
|
system( |
|
'metasend -b -t '.$emailto.' -s '. |
|
"'$subj' -f /tmp/CHECKRPMS.$$ -m text/plain"); |
|
} |
} |
} |
|
|
print($out <<END) if $mode eq 'html'; # If html mode, print ending tags. |
print($out <<END) if $mode eq 'html'; # If html mode, print ending tags. |