Index: /issm/trunk/cron/configs/linux64_morlighem
===================================================================
--- /issm/trunk/cron/configs/linux64_morlighem	(revision 1529)
+++ /issm/trunk/cron/configs/linux64_morlighem	(revision 1530)
@@ -1,4 +1,8 @@
 #SVN repository
 REPOSITORY="http://s383-rhat/issm/svn/issm/trunk"
+
+#email adress to send Cron report
+EMAIL_ADRESS="mathieu.morlighem@jpl.nasa.gov"
+
 
 #ISSM directory
@@ -8,6 +12,9 @@
 ISSM_ARCH="linux-gnu-amd64"
 
-#external pakages configs:
-EP_CONFIG="linux64"
+#Operating System
+OS="linux64"
+
+#external pakages to be installed
+EP_LIST="mpich2 petsc metis triangle"
 
 #number of cpus
Index: sm/trunk/cron/configs/macosx32
===================================================================
--- /issm/trunk/cron/configs/macosx32	(revision 1529)
+++ 	(revision )
@@ -1,23 +1,0 @@
-#SVN repository
-REPOSITORY="http://s383-rhat/issm/svn/issm/trunk"
-
-#ISSM directory
-ISSM_DIR="/Users/seroussi/Desktop/backup/svn/issm/trunk/cron/trunk"
-
-#ISSM Architecture
-ISSM_ARCH="macosx-gnu"
-
-#external pakages configs:
-EP_CONFIG="macosx32"
-
-#number of cpus
-NUMCPUS=""
-
-#MATLAB path
-MATLAB_PATH="Applications/MATLAB_R2009a.app/"
-
-#execution path
-EXECUTION_PATH=""
-
-#packages to be run
-PACKAGES="{'macayeal','cielo_serial'}"
Index: /issm/trunk/cron/configs/macosx32_seroussi
===================================================================
--- /issm/trunk/cron/configs/macosx32_seroussi	(revision 1530)
+++ /issm/trunk/cron/configs/macosx32_seroussi	(revision 1530)
@@ -0,0 +1,29 @@
+#SVN repository
+REPOSITORY="http://s383-rhat/issm/svn/issm/trunk"
+
+#email adress to send Cron report
+EMAIL_ADRESS="helene.seroussi@jpl.nasa.gov"
+
+#ISSM directory
+ISSM_DIR="/Users/seroussi/Desktop/backup/svn/issm/trunk/cron/trunk"
+
+#ISSM Architecture
+ISSM_ARCH="macosx-gnu"
+
+#Operating System
+OS="macosx"
+
+#external pakages to be installed
+EP_LIST="mpich2 petsc metis triangle"
+
+#number of cpus
+NUMCPUS=1
+
+#MATLAB path
+MATLAB_PATH="Applications/MATLAB_R2009a.app/"
+
+#execution path
+EXECUTION_PATH=""
+
+#packages to be run
+PACKAGES="{'macayeal','cielo_serial'}"
Index: /issm/trunk/cron/nightlyrun.sh
===================================================================
--- /issm/trunk/cron/nightlyrun.sh	(revision 1529)
+++ /issm/trunk/cron/nightlyrun.sh	(revision 1530)
@@ -6,5 +6,5 @@
 if [ $# -ne 1 ];
 then
-	CONFIG_FILE=$1;
+	source config/$1;
 else
 	echo "no config file specified. Exiting..."
@@ -12,11 +12,11 @@
 
 #create nightly run variables
-export today=`date | awk '{printf("%s-%s-%s",$2,$3,$6);}'`;
-export host_name=`hostname`;
+export TODAY=`date | awk '{printf("%s-%s-%s",$2,$3,$6);}'`;
+export HOST_NAME=`hostname`;
+export ISSM_RELEASE="issm"
 
 #create ISSM variables
 export ISSM_DIR
 export ISSM_ARCH
-export ISSM_RELEASE
 
 #Erase previous code and Fetch the new one
@@ -25,49 +25,39 @@
 
 #install ISSM
-cd $ISSM_DIR
 
 #1: modify some variables
-cd etc
-	#modify MATLAB_PATH ( /usr/...   ->   \/usr\/...)
-	echo $MATLAB_PATH | sed 's/\//\\\//g' > MATLAB_PATH2
-	MATLAB_PATH2=`cat MATLAB_PATH2`
-	rm MATLAB_PATH2
+cd $ISSM_DIR/etc
 
-	#modify MATLAB_DIR in environment_variables.sh
-	cat environment_variables.sh | sed -e "s/C:\/MATLAB\/R2009a\//$MATLAB_PATH2/g" > environment_variables.sh.bak
-	mv environment_variables.sh.bak environment_variables.sh
+#modify MATLAB_PATH ( /usr/...   ->   \/usr\/...)
+echo $MATLAB_PATH | sed 's/\//\\\//g' > MATLAB_PATH2
+MATLAB_PATH2=`cat MATLAB_PATH2`
+rm MATLAB_PATH2
 
-	#modify EXECUTION_PATH ( /usr/...   ->   \/usr\/...)
-	echo $EXECUTION_PATH | sed 's/\//\\\//g' | sed 's/-/\\-/g' > EXECUTION_PATH2
-	EXECUTION_PATH2=`cat EXECUTION_PATH2`
-	rm EXECUTION_PATH2
-	echo $ISSM_DIR\/bin | sed 's/\//\\\//g' | sed 's/-/\\-/g' > CLUSTER_PATH
-	CLUSTER_PATH=`cat CLUSTER_PATH`
-	rm CLUSTER_PATH
+#modify MATLAB_DIR in environment_variables.sh
+cat environment_variables.sh | sed -e "s/C:\/MATLAB\/R2009a\//$MATLAB_PATH2/g" > environment_variables.sh.bak
+mv environment_variables.sh.bak environment_variables.sh
 
-	#modify EXECUTION_PATH in cluster.rc
-	cat cluster.rc | sed -e "s-cluster_codepath.*-cluster_codepath\=$CLUSTER_PATH-" | sed -e "s-cluster_executionpath.*-cluster_executionpath\=$EXECUTION_PATH2-" > cluster.bak
-	mv cluster.bak cluster.rc
-cd ..
+#Create cluster.rc
+cat <<END > cluster.rc
+begin
+cluster_name=$HOST_NAME
+cluster_codepath=$ISSM_DIR/bin
+cluster_executionpath=$EXECUTION_PATH
+end
+END
 source $ISSM_DIR/etc/environment.sh
 
 #2: install some required external packages
-cd externalpackages
-	cd mpich2
-	cp configs/$EP_CONFIG/* .
+cd $ISSM_DIR/externalpackages
+for EP in $EP_LIST
+do 
+	cd $EP
+	cp configs/$OS/* .
 	./install.sh $NUMCPUS
-cd ../petsc
-	cp configs/$EP_CONFIG/* .
-	./install.sh $NUMCPUS
-cd ../metis
-	cp configs/$EP_CONFIG/* .
-	./install.sh $NUMCPUS
-cd ../triangle
-	cp configs/$EP_CONFIG/* .
-	./install.sh $NUMCPUS
-cd $ISSM_DIR
+	cd ..
+done
 
 #3: install automake and autoconf
-cd devpackages
+cd $ISSM_DIR/devpackages
 make
 cd ..
@@ -75,15 +65,9 @@
 #3: generate MakeFiles
 sh scripts/automakererun.sh
-sh config/wilkes/linux64.sh
+sh config/$OS/$OS.sh
 
 #4: compile and install ISSM
-if [ -z $NUMCPUS ];
-then
-	make
-	make install
-else
-	make  -j $NUMCPUS
-	make  -j $NUMCPUS install
-fi
+make  -j $NUMCPUS
+make  -j $NUMCPUS install
 
 #Launch matlab and the nightly run script
@@ -104,5 +88,5 @@
 for i in `echo $MAILINGLIST`; do
 cat - report.html <<HERE | /usr/lib/sendmail  -oi -t
-From: "ISSM Nightly run" <mathieu.morlighem@jpl.nasa.gov>
+From: "ISSM Nightly run" <$EMAIL_ADRESS>
 To: $i
 Subject: Nightly runs of $ISSM_RELEASE on: $host_name. Date:$today.
Index: /issm/trunk/cron/report.sh
===================================================================
--- /issm/trunk/cron/report.sh	(revision 1529)
+++ /issm/trunk/cron/report.sh	(revision 1530)
@@ -80,6 +80,6 @@
 <br>
 <div class="issmcomment">
-date: $today<br>
-host: $host_name<br>
+date: $TODAY<br>
+host: $HOST_NAME<br>
 platform: $ISSM_ARCH<br>
 release: $ISSM_RELEASE<br>
