#!/bin/sh
#to start a subsystem from a groovy description file given as the first parameter
#and a proerties file given as the second parameter
usage="$0 groovy_description_file_name properties_file_name"
echo $usage

exemple1="$0 testbenchAPC.groo testbenchAPC_XXXXX_.properties"
echo "For APCTestBench run: $exemple1"
exemple2="$0 single-filter-test__hardware.groovy single-filter-test_CPPMhardware.properties"
echo "For single-filter-test in CPPM run: $exemple2"

DESCRIPTIONFILE=$1
PROPERTIESFILE=$2
echo "PROPERTIESFILE= $PROPERTIESFILE"


FCSDIR=/Users/virieux/lsst/CameraControl/org-lsst-ccs-subsystem-fcs/trunk/main
CONFDIR=$FCSDIR/src/main/resources/org/lsst/ccs/subsystems/fcs/conf

echo "Running $0 with description file = $CONFDIR/$DESCRIPTIONFILE and properties file = $FCSDIR/$PROPERTIESFILE"

#For GROUPS
OPT="-Dlsst.messaging.factory=org.lsst.ccs.bus.BusMessagingFactory -Dlsst.groups.trybroadcast=true"

cd $FCSDIR

mvn -e -Dexec.args="$CONFDIR/$DESCRIPTIONFILE $PROPERTIESFILE" -Dexec.mainClass=org.lsst.ccs.startup.SubsystemBootFromStream  -PJGroup $OPT exec:java
