Index: /issm/trunk/cron/nightlyrun.sh
===================================================================
--- /issm/trunk/cron/nightlyrun.sh	(revision 1573)
+++ /issm/trunk/cron/nightlyrun.sh	(revision 1574)
@@ -44,4 +44,5 @@
 export HOST_NAME=`hostname`;
 export ISSM_RELEASE="issm"
+export OS
 
 #create ISSM variables
Index: /issm/trunk/cron/report.sh
===================================================================
--- /issm/trunk/cron/report.sh	(revision 1573)
+++ /issm/trunk/cron/report.sh	(revision 1574)
@@ -26,7 +26,8 @@
 fi
 
-
 #build report.html
-cat <<END > report.html
+
+#first: header
+cat << END > header.html
 <html>
 <title>ISSM - Nightly run Report</title>
@@ -93,4 +94,8 @@
 <div class="issmh1">ISSM Nightly run report</div>
 <br>
+END
+
+#then: summary
+cat << END > summary.html
 <div class="issmcomment">
 date: $TODAY<br>
@@ -105,29 +110,26 @@
 then
 	#installation failed, end of report
-	echo "<span style=\"color:#FF0000\">installation failed</span>"
+	echo "<span style=\"color:#FF0000\">installation failed</span></div>"
+	rm check.log errors.log success.log tests.log
+else
+	if [ $IS_END==0 ];
+	then
+		echo "<span style=\"color:#FF0000\">stopped before the end</span>"
+	else
+		echo "all test desks have been run"
+	fi
+	echo "<br>"
+	echo "number of errors: $(wc -l errors.log | awk '{printf("%s",$1);}')/$(wc -l tests.log | awk '{printf("%s",$1);}';  rm errors.log)<br>"
+	echo "number of success: $(wc -l success.log | awk '{printf("%s",$1);}')/$(wc -l tests.log | awk '{printf("%s",$1);}';rm success.log tests.log)</div>"
 	echo "<br>"
 	echo "<hr width=\"900px\">"
-	echo "</div>"
-	echo "<br>"
-	echo "<br>"
-	echo "<div class=\"issmfooter\"><a href=\"http://issm.jpl.nasa.gov\" title=\"ISSM website\" target=\"_blank\">ISSM</a> nightly run report</div>"
-	echo "</body>"
-	echo "</html>"
-	exit 1
-else
-	if [ $IS_END==0 ];
-	then
-		echo "<span style=\"color:#FF0000\">stopped before the end</span></div>"
-	else
-		echo "all test desks have been run"
-	fi
-fi
-rm check.log) 
-<br>
-number of errors: $(wc -l errors.log | awk '{printf("%s",$1);}')/$(wc -l tests.log | awk '{printf("%s",$1);}';  rm errors.log)<br>
-number of success: $(wc -l success.log | awk '{printf("%s",$1);}')/$(wc -l tests.log | awk '{printf("%s",$1);}';rm success.log tests.log)</div>
-<br>
-<hr width="900px">
-
+	rm check.log
+fi) 
+END
+
+#report content
+if [ $IS_END != 0 ];
+then
+	cat << END > content.html
 $(for  package in "macayeal" "ice" "cielo_serial" "cielo_parallel"; do
 
@@ -189,6 +191,14 @@
 
 done)
-
-<br>
+<br>
+END
+else
+	for  package in "macayeal" "ice" "cielo_serial" "cielo_parallel"; do
+		rm $package.log
+	done
+fi
+
+#last footer
+cat << END > footer.html
 <br>
 <div class="issmfooter"><a href="http://issm.jpl.nasa.gov" title="ISSM website" target="_blank">ISSM</a> nightly run report</div>
@@ -196,2 +206,12 @@
 </html>
 END
+
+#concatenate files
+if [ $IS_END != 0 ];
+then
+	cat header.html summary.html content.html footer.html > report.html
+	rm  header.html summary.html content.html footer.html
+else
+	cat header.html summary.html footer.html > report.html
+	rm  header.html summary.html footer.html
+fi
