[LON-CAPA-cvs] cvs: loncom /build CHECKRPMS
raeburn
raeburn at source.lon-capa.org
Tue Oct 18 23:21:29 EDT 2011
raeburn Wed Oct 19 03:21:29 2011 EDT
Modified files:
/loncom/build CHECKRPMS
Log:
- If last run of CHECKRPMS created a /home/httpd/html/lon-status/checkrpms.txt
unlink it at the start of the next run.
Index: loncom/build/CHECKRPMS
diff -u loncom/build/CHECKRPMS:1.14 loncom/build/CHECKRPMS:1.15
--- loncom/build/CHECKRPMS:1.14 Mon Oct 17 19:11:42 2011
+++ loncom/build/CHECKRPMS Wed Oct 19 03:21:29 2011
@@ -3,7 +3,7 @@
# The LearningOnline Network with CAPA
# Checks status of RPM packages on system.
#
-# $Id: CHECKRPMS,v 1.14 2011/10/17 19:11:42 raeburn Exp $
+# $Id: CHECKRPMS,v 1.15 2011/10/19 03:21:29 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -85,6 +85,12 @@
print TMPFILE localtime(time).' '.$hostname."\n";
close(TMPFILE);
+if ($docroot ne '') {
+ if (-e "$docroot/lon-status/checkrpms.txt") {
+ unlink("$docroot/lon-status/checkrpms.txt");
+ }
+}
+
my ($cmd,$send,$addsubj);
if ($distro =~ /^fedora\d+$/) {
$cmd = 'yum update';
@@ -145,6 +151,10 @@
$subj .= $addsubj;
if ($docroot ne '') {
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});
}
More information about the LON-CAPA-cvs
mailing list