Improvements from anna fork
[anna.git] / example / diameter / launcher / deployments / aots / agents / ADML / start.sh
1 #!/bin/bash
2 # $1: args type could be 'ft' (function test) or 'st' (system test). By default: ft
3 function pgrep_live {
4   pids=$(pgrep "$1");
5   [ "$pids" ] || return;
6   ps -o s= -o pid= $pids | sed -n 's/^[^ZT][[:space:]]\+//p';
7 }
8 cd `dirname $0`
9 ARGS=args.$1
10 [ -z "$1" ] && ARGS=args.ft
11 STARTED=`pgrep_live ADML`
12 [ -n "$STARTED"  ] && { echo "Already started !"; echo "PID $STARTED" ; exit 1 ; }
13 0> launcher.trace
14 for file in `ls *.launcher.log 2>/dev/null`; do 0> $file; done
15 mkdir -p counters test-reports
16 rm -f counters/* test-reports/* *.csv
17 export LD_LIBRARY_PATH=$PWD/dynlibs
18 ./ADML `grep -v ^# $ARGS` &
19 echo $! > .pid
20 echo "Done !"
21