version 1.1, 2005/04/13 18:56:46
|
version 1.2, 2005/07/29 21:14:03
|
Line 79 ENDHEADER
|
Line 79 ENDHEADER
|
close(TMPFILE); |
close(TMPFILE); |
|
|
# |
# |
# Execute yum command |
# Execute online_update command to check for updates |
my $command = $you.' -s -k -l en '.'>>'.$tmpfile; |
if (open (PIPE, "$you -d -k -l en 2>&1 |")) { |
system($command); |
my $output=<PIPE>; |
|
close(PIPE); |
|
chomp $output; |
|
unless ($output eq 'No updates available.') { |
|
my $command = $you.' -s -k -l en |grep ^[^I] >>'.$tmpfile; |
|
system($command); |
|
|
my $returnvalue = $?>>8; |
$subj.= ' RPMS to upgrade'; |
|
# Send email |
# |
system(qq{mail -s '$subj' $emailto < $tmpfile}); |
# Determine status of yum run |
} |
if (100 == $returnvalue) { |
} else { |
$subj.= ' RPMS to upgrade'; |
|
# Send email |
|
system(qq{mail -s '$subj' $emailto < $tmpfile}); |
|
} elsif (0 != $returnvalue) { |
|
# Send email |
# Send email |
$subj.= ' Error running RPM update script'; |
$subj.= ' Error running RPM update script'; |
system(qq{mail -s '$subj' $emailto < $tmpfile}); |
system(qq{mail -s '$subj' $emailto < $tmpfile}); |
} else { |
|
# you returned 0, so everything is up to date. |
|
} |
} |