runApp.sh 680 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
# /bin/sh

# default DiSL lib path
if [ -z "${DISL_LIB_P}" ]; then
    DISL_LIB_P=../build
fi

# test number of arguments
EXPECTED_ARGS=2
if [ $# -lt $EXPECTED_ARGS ]
then
	echo "Usage: `basename $0` instr-lib java-params"
	exit
fi

# set server file
SERVER_FILE=.server.pid
export SERVER_FILE

# kill running server
if [ -e ${SERVER_FILE} ]
then
	kill -KILL `cat ${SERVER_FILE}`
24
	rm ${SERVER_FILE}
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
fi

export DISL_LIB_P

# start server (with instrumentation library) and take pid
./runServer.sh $1

# wait for server startup
sleep 3

# run client
./runClient.sh $*

# wait for server shutdown
sleep 1

# kill server
kill -KILL `cat ${SERVER_FILE}` 2> /dev/null
43
rm ${SERVER_FILE}