Keep output being visible
[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 0> ADML.output
15 for file in `ls *.launcher.log 2>/dev/null`; do 0> $file; done
16 mkdir -p counters test-reports
17 rm -f counters/* test-reports/* *.csv
18 export LD_LIBRARY_PATH=$PWD/dynlibs
19 args=$(eval echo $(grep -v ^# $ARGS))
20 #ulimit -c unlimited
21 ./ADML ${args} | tee -a ADML.output &
22 pgrep_live ADML > .pid
23 echo "Done !"
24