version 1.12, 2002/12/11 18:28:30
|
version 1.16, 2003/06/19 19:23:56
|
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 112 my @serverpaths_to_try =
|
Line 111 my @serverpaths_to_try =
|
); |
); |
|
|
# -------------------------------------------- Use check-rpms command this way. |
# -------------------------------------------- Use check-rpms command this way. |
my $checkcommand = 'check-rpms '.$download.' --rpmuser www -ftp'; |
my $checkcommand = 'check-rpms -nk '.$download.' --rpmuser www -ftp'; |
|
|
my $FTPSERVER; # ------------------------- the server portion of the serverpath |
my $FTPSERVER; # ------------------------- the server portion of the serverpath |
my $FTPUPDATES; # ----------------------------- the actual update root location |
my $FTPUPDATES; # ----------------------------- the actual update root location |
Line 196 SERVERLOOP: foreach my $serverpath (@ser
|
Line 195 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 331 sub clean_exit
|
Line 330 sub clean_exit
|
delete $perlvar{'lonSqlAccess'}; # remove since sensitive |
delete $perlvar{'lonSqlAccess'}; # remove since sensitive |
|
|
# Set metadata for the e-mail. |
# Set metadata for the e-mail. |
my $emailto = "$perlvar{'lonAdmEMail'},$perlvar{'lonSysEMail'}"; |
my $emailto = "$perlvar{'lonAdmEMail'}"; |
|
|
my $subj=$perlvar{'lonHostID'}.', RPMS to upgrade'; |
my $subj=$perlvar{'lonHostID'}.', RPMS to upgrade'; |
|
|
Line 346 sub clean_exit
|
Line 345 sub clean_exit
|
} |
} |
|
|
# Send the e-mail. |
# Send the e-mail. |
if (!$reallygoodoutput) |
my $date = `date +"\%e"`; # Always send a day after the "Ides" or after |
|
# the beginning of a month. (In other words, |
|
# send an e-mail every two weeks regardless.) |
|
if (!$reallygoodoutput or |
|
$date == 2 or |
|
$date == 16) |
{ |
{ |
system( |
system( |
'metasend -b -t '.$emailto.' -s '. |
'metasend -b -t '.$emailto.' -s '. |