run_all.bash 953 Bytes
Newer Older
Yann Garcia's avatar
Yann Garcia committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
#set -e
#set -vx

clear

export LD_LIBRARY_PATH=/home/${USER}/frameworks/osip/src/osipparser2/.libs:$LD_LIBRARY_PATH

if ! [[ $1 =~ "^[0-9]+$" ]]
then
    COUNTER=$1
else
    COUNTER=1
fi

CURPWD=`pwd`
if [ ! "${PWD##*/}" == "objs" ]
then
    cd ../objs
    if [ ! $? == 0 ]
    then
        echo "Please move to PROJECT/obj directory"
        exit 1
    fi
fi

Yann Garcia's avatar
Yann Garcia committed
27
28
29
30
for i in `ls ../logs/merged.*.log`
do
    rm -f $i
done
Yann Garcia's avatar
Yann Garcia committed
31
32
33
34
35
36
37
38
39
40
41
42
43
44

for i in $(seq 1 1 $COUNTER)
do
    LD_LIBRARY_PATH=/home/${USER}/frameworks/osip/src/osipparser2/.libs:$LD_LIBRARY_PATH ../bin/run_mtc.bash &
    LD_LIBRARY_PATH=/home/${USER}/frameworks/osip/src/osipparser2/.libs:$LD_LIBRARY_PATH ../bin/run_ptcs.bash $2

    dup=$(ps -ef | grep "$0" | grep -v grep | wc -l)
    while [ ${dup} -eq 3 ]
    do
        sleep 1
        dup=$(ps -ef | grep "$0" | grep -v grep | wc -l)
    done
    sleep 1
    
Yann Garcia's avatar
Yann Garcia committed
45
    mv ../logs/merged.log ../logs/merged.`date +'%Y%m%d%S'`.log
Yann Garcia's avatar
Yann Garcia committed
46
47
48
49
50
done

exit 0