version 1.4, 2006/10/05 17:44:38
|
version 1.6, 2006/10/10 19:27:48
|
Line 80 if ($distro =~ /^fedora\d+$/) {
|
Line 80 if ($distro =~ /^fedora\d+$/) {
|
$cmd = 'yum update'; |
$cmd = 'yum update'; |
&prepare_msg($tmpfile,$cmd); |
&prepare_msg($tmpfile,$cmd); |
($send,$addsubj) = &check_with_yum($tmpfile); |
($send,$addsubj) = &check_with_yum($tmpfile); |
} elsif ($distro =~ /^(suse|sles)9\.\d$/) { |
} elsif ($distro =~ /^(suse|sles)9\.?\d?$/) { |
$cmd = 'you'; |
$cmd = 'you'; |
&prepare_msg($tmpfile,$cmd); |
&prepare_msg($tmpfile,$cmd); |
($send,$addsubj) = &check_with_you($tmpfile); |
($send,$addsubj) = &check_with_you($tmpfile); |
Line 113 $cmd
|
Line 113 $cmd
|
|
|
to bring it up to date. |
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. |
This is very important for the security of your server. The packages which need to be updated are listed below. |
|
|
ENDHEADER |
ENDHEADER |
close(TMPFILE); |
close(TMPFILE); |
Line 126 sub check_with_you {
|
Line 126 sub check_with_you {
|
my $sendflag = 0; |
my $sendflag = 0; |
my $append_to_subj; |
my $append_to_subj; |
|
|
if (open (PIPE, "$you -d -k -l en 2>&1 |")) { |
if (open (PIPE, "$you -k -len 2>&1 |")) { |
my $output=<PIPE>; |
my $output=<PIPE>; |
close(PIPE); |
close(PIPE); |
chomp $output; |
chomp $output; |
unless ($output eq 'No updates available.') { |
unless ($output eq 'No updates available.') { |
my $command = $you.' -s -k -l en |grep ^[^I] >>'.$tmpfile; |
if (open (PIPE, "$you -s -d -len |grep ^INSTALL |")) { |
system($command); |
my @updates = <PIPE>; |
$sendflag = 1; |
close(PIPE); |
$append_to_subj = ' RPMS to upgrade'; |
my $allpackages; |
|
foreach my $line (@updates) { |
|
my $package = substr($line,rindex($line,'/')+1); |
|
if ($package ne '') { |
|
$allpackages .= $package; |
|
} |
|
} |
|
if ($allpackages ne '') { |
|
open(TMPFILE,">>$tmpfile"); |
|
print TMPFILE $allpackages; |
|
close(TMPFILE); |
|
$sendflag = 1; |
|
$append_to_subj = ' RPMS to upgrade'; |
|
} |
|
} else { |
|
$sendflag = 1; |
|
$append_to_subj = ' Error running RPM update script'; |
|
} |
} |
} |
} else { |
} else { |
$sendflag = 1; |
$sendflag = 1; |
Line 239 sub check_with_rug {
|
Line 256 sub check_with_rug {
|
last; |
last; |
} elsif ($line eq 'No updates are available.') { |
} elsif ($line eq 'No updates are available.') { |
last; |
last; |
|
} elsif ($line eq 'Downloading Packages...') { |
|
last; |
} else { |
} else { |
push(@clean_output,$line); |
push(@clean_output,$line); |
} |
} |