[LON-CAPA-cvs] cvs: loncom /build CHECKRPMS

harris41 lon-capa-cvs@mail.lon-capa.org
Fri, 15 Nov 2002 18:42:34 -0000


harris41		Fri Nov 15 13:42:34 2002 EDT

  Modified files:              
    /loncom/build	CHECKRPMS 
  Log:
  BUG 970 FIXED; now the cronmail option email subject header line will
  indicate whether the system is happy or in need of being updated with
  RPMs
  
  
Index: loncom/build/CHECKRPMS
diff -u loncom/build/CHECKRPMS:1.10 loncom/build/CHECKRPMS:1.11
--- loncom/build/CHECKRPMS:1.10	Sun Nov  3 21:53:07 2002
+++ loncom/build/CHECKRPMS	Fri Nov 15 13:42:34 2002
@@ -321,6 +321,7 @@
     if ($mode eq 'cronmail') # If cronmail mode, then mail LON-CAPA sys admin.
       {
         close(FOUT);
+
 	# Read in configuration to get e-mail addresses.
 	my $perlvarref = read_conf('loncapa.conf');
 	my %perlvar = %{$perlvarref};
@@ -330,8 +331,20 @@
 
 	# Set metadata for the e-mail.
         my $emailto = "$perlvar{'lonAdmEMail'},$perlvar{'lonSysEMail'}";
-#	my $emailto = "sharrison\@users.sourceforge.net";
-	my $subj="LON: $perlvar{'lonHostID'}, RPMS to upgrade";
+
+	my $subj=$perlvar{'lonHostID'}.', RPMS to upgrade';
+
+	# Make the e-mail's subject header to describe whether up-to-date.
+	if ($reallygoodoutput)
+	  {
+	    $subj = 'happy_lon: '.$subj; # Machine is up-to-date.
+	  }
+	else
+	  {
+	    $subj = 'ALERT_lon: '.$subj; # There are out-of-date RPMs.
+	  }
+
+	# Send the e-mail.
 	system(
 	       'metasend -b -t '.$emailto.' -s '.
 	       "'$subj' -f /tmp/CHECKRPMS.$$ -m text/plain");