Deploy lite version
[anna.git] / example / diameter / launcher / resources_lite / run.sh
1 #!/bin/bash
2
3 # Diameter dictionary and endpoints:
4 DICTIONARY=stacks/avps_etsi.xml,stacks/avps_ietf.xml,stacks/avps_tgpp.xml,stacks/commands_baseProtocol.xml,stacks/commands_pccPS_EricssonSAPC_se.xml
5 SERVER=localhost:3868
6 ENTITY=192.168.12.11:3868,192.168.12.21:3868
7 CONNS=10
8
9 # Perhaps the stack is not fully defined:
10 KINDNESS=-ignoreErrors
11
12 # Tracing (comment the second line if you need detailed traces):
13 TRACING="-trace debug"
14 TRACING=
15
16 # General
17 EXE=./ADL-launcher
18
19 echo
20 echo
21 PID=$(pgrep `basename $EXE`)
22 if [ $? -eq 0 ]
23 then 
24   echo "The process '$EXE' seems to be already started (pid: $PID)."
25   echo "Press ENTER to continue, CTRL-C to abort ..."
26   read dummy
27 fi
28
29 echo "Run as a (c)lient, (s)erver, (b)alancer or (d)ummy [c]:"
30 read option
31 [[ "$option" = "" ]] && option=c
32
33 case $option in
34   c) $EXE -dictionary $DICTIONARY -entity $ENTITY -entityServerSessions $CONNS -diameterServerSessions 0 $KINDNESS $TRACING &
35      ;;
36
37   s) $EXE -dictionary $DICTIONARY -diameterServer $SERVER -diameterServerSessions $CONNS -entityServerSessions 0 $KINDNESS $TRACING &
38      ;;
39
40   b) $EXE -dictionary $DICTIONARY -entity $ENTITY -entityServerSessions $CONNS -diameterServer $SERVER -diameterServerSessions $CONNS -balance $KINDNESS $TRACING &
41      ;;
42
43   d) $EXE -dictionary $DICTIONARY -entityServerSessions 0 -diameterServerSessions 0 $KINDNESS $TRACING &
44      ;;
45
46   *) echo "Option '$option' not implemented !!"
47      ;;
48 esac
49