#! /usr/bin/ksh

APLIC=ad74a
BATCH_CLASS=com.ejie.ad74a.BatchLauncher
CADENA_CONEXION=35772
SUBTIPO_CONEXION=01

. /aplic/$APLIC/.profile 

APLIC_PATH=/aplic/$APLIC

date
cd $APLIC_PATH

. /aplic/n38/cade/n38bd $CADENA_CONEXION $SUBTIPO_CONEXION STRING

STAT=$?
if [ $STAT != 0 ]; then
    echo "ERROR N38BD"
    exit 1
else
   BD=`echo $STRING |cut -d '#' -f1`
   USU=`echo $STRING |cut -d '#' -f2`
   PASS=`echo $STRING |cut -d '#' -f3`
fi

#Todos los argumentos pasados a esta cadena se trasladan al proceso de BatchLauncher ($*)
ant -Dclase=$BATCH_CLASS -Dsource=1.8 -Dmemory=1024m -Dparams="$BD $USU $PASS $*" batch

cSTATUS=${?}
date
if [ $cSTATUS != 0 ]; then
   	exit 1   	
else
	exit 0 
fi;

exit 0
