version 1.14, 2011/10/17 19:11:42
|
version 1.15, 2011/10/19 03:21:29
|
Line 85 open(TMPFILE,">$tmpfile");
|
Line 85 open(TMPFILE,">$tmpfile");
|
print TMPFILE localtime(time).' '.$hostname."\n"; |
print TMPFILE localtime(time).' '.$hostname."\n"; |
close(TMPFILE); |
close(TMPFILE); |
|
|
|
if ($docroot ne '') { |
|
if (-e "$docroot/lon-status/checkrpms.txt") { |
|
unlink("$docroot/lon-status/checkrpms.txt"); |
|
} |
|
} |
|
|
my ($cmd,$send,$addsubj); |
my ($cmd,$send,$addsubj); |
if ($distro =~ /^fedora\d+$/) { |
if ($distro =~ /^fedora\d+$/) { |
$cmd = 'yum update'; |
$cmd = 'yum update'; |
Line 145 if ($send) {
|
Line 151 if ($send) {
|
$subj .= $addsubj; |
$subj .= $addsubj; |
if ($docroot ne '') { |
if ($docroot ne '') { |
system("cat $tmpfile > $docroot/lon-status/checkrpms.txt"); |
system("cat $tmpfile > $docroot/lon-status/checkrpms.txt"); |
|
if ($< == 0) { |
|
system("chown www:www $docroot/lon-status/checkrpms.txt"); |
|
} |
|
chmod(0600,$docroot/lon-status/checkrpms.txt"); |
} |
} |
system(qq{mail -s '$subj' "$emailto" < $tmpfile}); |
system(qq{mail -s '$subj' "$emailto" < $tmpfile}); |
} |
} |