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 )
26 echo "Usage: $0 [deployment_type: a|b|f] [deployment_path]"
28 echo " deployment_type:"
31 echo " f=function test client"
32 echo " deployment_path:"
33 echo " non-existent path directory."
36 echo " $0 b $HOME/ADL/basicServer"
37 echo " $0 b $HOME/ADL/MMSbalancer"
38 echo " $0 f $HOME/ADL/tester"
46 # Basic launcher 'run.sh' will be created at deployment configuration:
47 [ "$1" = "b" ] && return
48 [ "$1" = "a" ] && exe=ADL-launcher
49 [ "$1" = "f" ] && { exe=ADL-ftclient ; ln -s ADL-launcher $exe ; }
55 STARTED=\`pgrep \$EXE 2>/dev/null\`
56 [ \$? -eq 0 ] && { echo "Already started!"; echo "\$STARTED" ; exit 1 ; }
61 ./\$EXE -cntDir counters $(for i in `cat args.txt | grep -v "^#"`; do echo -n "$i "; done)&
69 createDictionaryPaths () {
70 for i in stacks/*commands*xml
72 stacks/dependence.sh $i >/dev/null
74 if test "$stack" != "$BASE_PROT"
76 > .dictionary__${stack}
77 for j in `cat ${i}.dep`
79 echo -n "${j}," >> .dictionary__${stack}
81 echo "stacks/$BASE_PROT,stacks/${stack}" >> .dictionary__${stack}
86 ln -s .dictionary__commands_qosControl.xml .dictionary
97 echo "---------------------------------------"
98 echo "Anna Diameter Launcher (ADL) deployment"
99 echo "---------------------------------------"
100 [ "$1" = "--help" -o "$1" = "-h" ] && usage
101 echo " (--help or -h for more info)"
103 echo "Basic checkings ..."
105 for EXEC in ${EXECS[@]}; do
106 echo -n "Looking executable at '$EXEC' ... "
107 [ -x $EXEC ] && { available=yes ; echo "available !" ; break ; }
110 [ -z "$available" ] && _exit "Anna Diameter Launcher (ADL) is not installed neither linked. See README.md (Install section)."
111 [ ! -d $SETUPS_DIR ] && _exit "Diameter stacks not found ($SETUPS_DIR)."
117 echo "Deploy one of these versions:"
119 echo " (a)dvanced version: includes burst management script and templates for different scenarios. Automatic configuration during start."
120 echo " (b)asic version: 4 types of launcher (client, server, balancer, dummy), lightly configured and managed through SIGURS2 method."
121 echo " (f)unction test client: special client with regexp scheduler script based on splitted traffic logs."
123 echo "Input option [b]:"
125 [ "$option" = "" ] && option=b
132 echo "Advanced deployment"
133 DEPLOYMENTS_DIR=deployments/advanced
134 DPATH_dflt=$HOME/ADL-advanced
138 echo "Basic deployment"
139 DEPLOYMENTS_DIR=deployments/basic
140 DPATH_dflt=$HOME/ADL-basic
145 DEPLOYMENTS_DIR=deployments/ft-client
146 DPATH_dflt=$HOME/ADL-ft-client
150 _exit "Invalid deployment type '$option' !!"
157 echo "Input deployment path [$DPATH_dflt]:"
159 [ "$DPATH" = "" ] && DPATH=$DPATH_dflt
164 [ -d $DPATH ] && _exit "The installation path '$DPATH' must not exists."
166 echo "Copying to '$DPATH' ..."
168 mkdir -p $DPATH/stacks
170 mkdir -p $DPATH/counters
171 mkdir -p $DPATH/resources
172 if [ "$EXEC" = "$EXEC_installed" ]
174 ln -s $EXEC_installed $DPATH/ADL-launcher
176 cp $EXEC $DPATH/ADL-launcher
178 cp -rL $DEPLOYMENTS_DIR/* $DPATH
179 cp resources/* $DPATH/resources
180 cp $SETUPS_DIR/*xml $DPATH/stacks
181 cp $SETUPS_DIR/*sh $DPATH/stacks
182 cp $SETUPS_DIR/readme.txt $DPATH/stacks
183 cp $MSGDTD $DPATH/DTDs
184 cp $DCTDTD $DPATH/DTDs
188 createRunScript $option
189 createDictionaryPaths
194 echo "Go to '$DPATH' and see README file"