Fix start.sh script due to bad pid calculated
[anna.git] / example / diameter / launcher / deployments / adml / start.sh
1 #!/bin/bash
2 # $1: args type could be 'ft' (function test) or 'st' (system test), or 'help' to get the command line help. 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 args=$(eval echo $(grep -v ^# $ARGS))
19 ./ADML ${args} &
20 echo $! > .pid
21 echo "Done !"
22