6 SETUPS_DIR=../../../source/diameter/stack/setups
7 MSGDTD=../../../include/anna/diameter/codec/message.dtd
8 DCTDTD=../../../include/anna/diameter/stack/dictionary.dtd
9 BASE_PROT=commands_baseProtocol.xml
11 # Executables in priority order:
12 EXEC_installed=/opt/bin/anna/example_diameter_launcher
13 EXECS=( $EXEC_installed ./release/example_diameter_launcher ./debug/example_diameter_launcher )
28 # Basic launcher 'run.sh' will be created at deployment configuration:
29 [ "$1" = "b" ] && return
30 [ "$1" = "a" ] && exe=ADL-launcher
31 [ "$1" = "f" ] && { exe=ADL-ftclient ; ln -s ADL-launcher $exe ; }
37 STARTED=\`pgrep \$EXE 2>/dev/null\`
38 [ \$? -eq 0 ] && { echo "Already started!"; echo "\$STARTED" ; exit 1 ; }
43 ./\$EXE -cntDir counters $(for i in `cat args.txt | grep -v "^#"`; do echo -n "$i "; done)&
51 createDictionaryPaths () {
52 for i in stacks/*commands*xml
54 stacks/dependence.sh $i >/dev/null
56 if test "$stack" != "$BASE_PROT"
58 > .dictionary__${stack}
59 for j in `cat ${i}.dep`
61 echo -n "${j}," >> .dictionary__${stack}
63 echo "stacks/$BASE_PROT,stacks/${stack}" >> .dictionary__${stack}
68 ln -s .dictionary__commands_qosControl.xml .dictionary
79 echo "---------------------------------------"
80 echo "Anna Diameter Launcher (ADL) deployment"
81 echo "---------------------------------------"
83 echo "Basic checkings ..."
85 for EXEC in ${EXECS[@]}; do
86 echo -n "Looking executable at '$EXEC' ... "
87 [ -x $EXEC ] && { available=yes ; echo "available !" ; break ; }
90 [ -z "$available" ] && _exit "Anna Diameter Launcher (ADL) is not installed neither linked. See README.md (Install section)."
91 [ ! -d $SETUPS_DIR ] && _exit "Diameter stacks not found ($SETUPS_DIR)."
94 echo "Deploy one of these versions:"
96 echo " (a)dvanced version: includes burst management script and templates for different scenarios. Automatic configuration during start."
97 echo " (b)asic version: 4 types of launcher (client, server, balancer, dummy), lightly configured and managed through SIGURS2 method."
98 echo " (f)unction test client: special client with regexp scheduler script based on splitted traffic logs."
100 echo "Input option [b]:"
102 [ "$option" = "" ] && option=b
105 DEPLOYMENTS_DIR=deployments/advanced
106 DPATH_dflt=$HOME/ADL-advanced
110 DEPLOYMENTS_DIR=deployments/basic
111 DPATH_dflt=$HOME/ADL-basic
115 DEPLOYMENTS_DIR=deployments/ft-client
116 DPATH_dflt=$HOME/ADL-ft-client
120 _exit "Unknown option !!"
125 echo "Input deployment path [$DPATH_dflt]:"
127 [ "$DPATH" = "" ] && DPATH=$DPATH_dflt
128 [ -d $DPATH ] && _exit "The path '$DPATH' already exists. Remove it before continue..."
132 mkdir -p $DPATH/stacks
134 mkdir -p $DPATH/counters
135 mkdir -p $DPATH/resources
136 if [ "$EXEC" = "$EXEC_installed" ]
138 ln -s $EXEC_installed $DPATH/ADL-launcher
140 cp $EXEC $DPATH/ADL-launcher
142 cp -rL $DEPLOYMENTS_DIR/* $DPATH
143 cp resources/* $DPATH/resources
144 cp $SETUPS_DIR/*xml $DPATH/stacks
145 cp $SETUPS_DIR/*sh $DPATH/stacks
146 cp $SETUPS_DIR/readme.txt $DPATH/stacks
147 cp $MSGDTD $DPATH/DTDs
148 cp $DCTDTD $DPATH/DTDs
152 createRunScript $option
153 createDictionaryPaths
158 echo "Go to '$DPATH' and see README file"