Index: trunk/MagicSoft/Mars/datacenter/scripts/sourcefile
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/sourcefile	(revision 7465)
+++ trunk/MagicSoft/Mars/datacenter/scripts/sourcefile	(revision 7467)
@@ -61,10 +61,58 @@
 }
 
+function resetstatusvalues()
+{
+   statustime=NULL
+   starttime=NULL
+   failedcode=NULL
+   failedcomment=NULL
+   failedtime=NULL
+}
+
+function printstatusvalues()
+{
+   echo "the current values are:"
+   echo " statustime=$statustime"
+   echo " starttime=$starttime"
+   echo " failedcode=$failedcode"
+   echo " failedcomment=$failedcomment"
+   echo " failedtime=$failedtime"
+   echo "-- check: -$check-"
+   ech
+   echo ""
+}
+
 function setstatus()
 {
+   # set status values
+   resetstatusvalues
+   case $@ in 
+      start)   echo "start"
+               starttime="Now()"
+               ;;
+       stop)   echo "stop"
+               case $check in
+                  0)  echo " ok"
+                      statustime="Now()"
+                      ;;
+                  *)  echo " failed"
+                      starttime=noreset
+                      failedcode=$check
+                      failedcomment=$com
+                      failedtime="Now()"
+                      ;;
+               esac
+               ;;
+          *)   echo "error -> exit"
+               exit
+               ;;
+   esac
+   check=
+   
+   # set status 
    setstatuslogpath=$logpath/setstatus/$program/$var1
    makedir $setstatuslogpath >> $scriptlog 2>&1
-   setstatuslog=$setstatuslogpath/setstatus-$program-$var2.log
-   checkstatus=`root -q -b $macrospath/setstatus.C+\("\"$sequence\""\,"\"$table\""\,"\"$column\""\,"\"$statustime\""\,"\"$failed\""\,"\"$starttime\""\,"\"$failedtime\""\) | tee $setstatuslog | grep int | sed -e 's/(int)//'`
+   setstatuslog=$setstatuslogpath/setstatus-$@-$program-$var2.log
+   checkstatus=`root -q -b $macrospath/setstatus.C+\("\"$sequence\""\,"\"$table\""\,"\"$column\""\,"\"$statustime\""\,"\"$failedcode\""\,"\"$failedcomment\""\,"\"$starttime\""\,"\"$failedtime\""\) | tee $setstatuslog | grep int | sed -e 's/(int)//'`
    case $checkstatus in
       1)   echo "checkstatus=$checkstatus -> everything ok, status has been set" >> $scriptlog 2>&1;;
@@ -72,2 +120,5 @@
    esac
 }
+
+
+
