3 # Functions & variables
4 SETUPS_DIR=../../../source/diameter/stack/setups
5 MSGDTD=../../../include/anna/diameter/codec/message.dtd
6 DCTDTD=../../../include/anna/diameter/stack/dictionary.dtd
7 BASE_PROT=commands_baseProtocol.xml
8 EXEC=./debug/example_diameter_launcher
10 RESOURCES_DIR=resources
21 echo "#!/bin/bash" > run.sh
22 echo "EXE=\`cat .exe 2>/dev/null\`" >> run.sh
23 echo "STARTED=\`ps -fea | grep \"\$EXE\" | grep -v grep\`" >> run.sh
24 echo "[ \"\$EXE\" != \"\" -a \"\$STARTED\" != \"\" ] && { echo \"Already started!\"; echo \"\$STARTED\" ; exit ; }" >> run.sh
25 echo "./pre-start.sh" >> run.sh
26 echo "> launcher.traces" >> run.sh
27 echo "EXE=\"./ADL-launcher\"" >> run.sh
28 echo "echo \$EXE > .exe" >> run.sh
30 echo -n "\$EXE " >> run.sh
31 for i in `cat args.txt | grep -v "^#"`
33 echo -n "$i " >> run.sh
40 createDictionaryPaths () {
42 for i in stacks/*commands*xml
44 stacks/dependence.sh $i >/dev/null
46 if test "$stack" != "$BASE_PROT"
48 > .dictionary__${stack}
49 for j in `cat ${i}.dep`
51 echo -n "${j}," >> .dictionary__${stack}
53 echo "stacks/$BASE_PROT,stacks/${stack}" >> .dictionary__${stack}
58 ln -s .dictionary__commands_qosControl.xml .dictionary
68 echo "---------------------------------------"
69 echo "Anna Diameter Launcher (ADL) deployment"
70 echo "---------------------------------------"
72 echo "Input deployment path [$DPATH_dflt]:"
74 [[ "$DPATH" = "" ]] && DPATH=$DPATH_dflt
75 [[ -d $DPATH ]] && _exit "The path '$DPATH' already exists. Remove it before continue..."
77 echo "Basic checkings ..."
78 [[ ! -f $EXEC ]] && _exit "Anna Diameter Launcher (ADL) is not linked. Execute 'scons' for 'anna' suite."
79 [[ ! -d $SETUPS_DIR ]] && _exit "Diameter stacks not found ($SETUPS_DIR). Perhaps you executed this script out of its parent path."
82 echo "Deploy (f)ull version or (l)ite version [l]:"
84 [[ "$deploy_type" = "" ]] && deploy_type=l
85 [[ "$deploy_type" = "l" ]] && RESOURCES_DIR=resources_lite
89 mkdir -p $DPATH/stacks
91 cp $EXEC $DPATH/ADL-launcher
92 cp -r $RESOURCES_DIR/* $DPATH
93 cp $SETUPS_DIR/*xml $DPATH/stacks
94 cp $SETUPS_DIR/*sh $DPATH/stacks
95 cp $SETUPS_DIR/readme.txt $DPATH/stacks
96 cp $MSGDTD $DPATH/DTDs
97 cp $DCTDTD $DPATH/DTDs
101 [[ "$deploy_type" != "l" ]] && createRunScript
102 createDictionaryPaths
107 echo "Go to '$DPATH' and see README file"