#! /bin/sh
. /fnal/ups/etc/setups.sh
ulimit -d unlimited -s unlimited -c 0
umask 002
echo ---------------------------------------------------------------
date
echo Begin setup of products needed
setup dp v14_151  
setup plate v3_7  
echo Done setup of products needed
echo ---------------------------------------------------------------
date
echo PATH = $PATH
echo ---------------------------------------------------------------
date
printenv | grep _DIR | sort
echo ---------------------------------------------------------------
echo Kerberos Data:
echo KRB5CCNAME=${KRB5CCNAME}
echo ---------------------------------------------------------------
cd /opdb/d1/data/drillRuns/dr2003.01.2
echo ---------------------------------------------------------------
date
echo Begin running plate
echo ---------------------------------------------------------------
date
echo Begin running makePlates -verbose=2
plate -noTk -command "makePlates -verbose=2" 
if [ $? -ne 0 ] 
then
    echo Error: makePlates -verbose=2 failed.
    exit 1
fi
echo ---------------------------------------------------------------
date
echo Begin running fiberPlates -verbose=2 -skipBrightCheck
plate -noTk -command "fiberPlates -verbose=2 -skipBrightCheck" 
if [ $? -ne 0 ] 
then
    echo Error: fiberPlates -verbose=2 -skipBrightCheck failed.
    exit 1
fi
echo ---------------------------------------------------------------
date
echo Begin running makeFanuc -verbose=2
plate -noTk -command "makeFanuc -verbose=2" 
if [ $? -ne 0 ] 
then
    echo Error: makeFanuc -verbose=2 failed.
    exit 1
fi
echo ---------------------------------------------------------------
date
echo Begin running makeDrillPos -verbose=2
plate -noTk -command "makeDrillPos -verbose=2" 
if [ $? -ne 0 ] 
then
    echo Error: makeDrillPos -verbose=2 failed.
    exit 1
fi
echo Done running plate
echo ---------------------------------------------------------------
date
echo Begin running plateEnder dr2003.01.2 -morePipes 1
plate -noTk -command "plateEnder dr2003.01.2 -morePipes 1 " 
if [ $? -ne 0 ] 
then
    echo Error: plateEnder dr2003.01.2 -morePipes 1 failed.
    exit 1
fi
echo ---------------------------------------------------------------
date
echo ALL DONE
exit

