Index: trunk/MagicSoft/Mars/datacenter/scripts/runcorsika
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/runcorsika	(revision 9177)
+++ trunk/MagicSoft/Mars/datacenter/scripts/runcorsika	(revision 9183)
@@ -40,5 +40,4 @@
    echo "RUNNR "$corsikarunno
    echo "PRMPAR "$primparticle
-   query="SELECT fEnergyMin, fEnergyMax FROM MCCorsikaRunData where fCorsikaRunNumber="$corsikarunno
    echo "ERANGE "$erange
    echo "EVTNR 1"
Index: trunk/MagicSoft/Mars/datacenter/scripts/sourcefile
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/sourcefile	(revision 9177)
+++ trunk/MagicSoft/Mars/datacenter/scripts/sourcefile	(revision 9183)
@@ -31,4 +31,11 @@
 #
 
+# check if script has been started with absolute path
+if ! dirname $0 | grep -E '^/' >/dev/null 2>&1
+then 
+   echo "Please start your script with an absolute path."
+   exit
+fi
+
 source `dirname $0`/setup 
 
@@ -67,4 +74,25 @@
 
 makedir $lockpath
+
+
+# function to provide proper logging in a single logfile ($processlog)
+function printprocesslog
+{
+   makedir $processlogpath
+   echo `date +%F\ %T`" "`whoami`"@"$HOSTNAME" "`basename $0`"["$$"] "$@ >> $processlog
+}
+
+# function to exit a script properly
+function finish()
+{
+   if ! [ "$lockfile" = "" ] && ls $lockfile >/dev/null 2>&1
+   then 
+      rm -v $lockfile
+   fi
+   date
+   printprocesslog "INFO finished $0"
+   exit
+}
+
 
 # set checkvalue to ok at the beginning of the scripts
@@ -112,5 +140,15 @@
 jmscriptlog=$runlogpath/jobmanager`date +%F`.log
 steps=$mars/resources/steps.rc
+if ! ls $steps >/dev/null
+then
+   echo "Can't find steps.rc ($steps)"
+   finish
+fi
 sqlrc=$mars/sql.rc
+if ! ls $sqlrc >/dev/null
+then
+   echo "Can't find sql.rc ($sqlrc)"
+   finish
+fi
 # resetting values
 pno=0
@@ -129,22 +167,4 @@
 # in the following the functions, which are needed by several scripts, are 
 # defined
-
-function printprocesslog
-{
-   makedir $processlogpath
-   echo `date +%F\ %T`" "`whoami`"@"$HOSTNAME" "`basename $0`"["$$"] "$@ >> $processlog
-}
-
-# function to exit a script properly
-function finish()
-{
-   if ! [ "$lockfile" = "" ] && ls $lockfile >/dev/null 2>&1
-   then 
-      rm -v $lockfile
-   fi
-   date
-   printprocesslog "INFO finished $0"
-   exit
-}
 
 # function to do continue in a loop and produce according logging
