version 1.1, 2004/07/12 19:24:49
|
version 1.2, 2004/07/19 21:01:51
|
Line 50 use LONCAPA::Configuration;
|
Line 50 use LONCAPA::Configuration;
|
|
|
my $yum = '/usr/bin/yum'; |
my $yum = '/usr/bin/yum'; |
my $tmpfile = '/tmp/CHECKRPMS.'.$$; |
my $tmpfile = '/tmp/CHECKRPMS.'.$$; |
my $command = 'date>'.$tmpfile.';'.$yum.' check-update '.'>>'.$tmpfile; |
|
|
|
# |
# |
# Determine who we email |
# Determine who we email |
Line 60 my $subj=$perlvar{'lonHostID'};
|
Line 59 my $subj=$perlvar{'lonHostID'};
|
undef(%perlvar); |
undef(%perlvar); |
|
|
# |
# |
|
# Put some nice text in $tmpfile |
|
my $hostname = `hostname`; |
|
chomp($hostname); |
|
open(TMPFILE,">$tmpfile"); |
|
print TMPFILE localtime(time).' '.$hostname."\n"; |
|
print TMPFILE <<ENDHEADER; |
|
Your system needs to be updated. Please execute (as root) |
|
|
|
yum update |
|
|
|
to bring it up to date. |
|
|
|
This is very important for the security of your server. The table below |
|
lists the packages which need to be updated. |
|
|
|
ENDHEADER |
|
|
|
close(TMPFILE); |
|
|
|
# |
# Execute yum command |
# Execute yum command |
|
my $command = $yum.' check-update '.'>>'.$tmpfile; |
system($command); |
system($command); |
|
|
my $returnvalue = $?>>8; |
my $returnvalue = $?>>8; |