X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2FDEPLOY.sh;h=4a29575ac4991e398ad68420b850dea2da81442d;hb=52ef1b135cc2eb90d51db903acb5bf0d49013aa7;hp=d5748602c9acd947193fac279be0e2c445e4d309;hpb=2591707d6a9019eea0a37cf69cf6b9e76242f600;p=anna.git diff --git a/example/diameter/launcher/DEPLOY.sh b/example/diameter/launcher/DEPLOY.sh index d574860..4a29575 100755 --- a/example/diameter/launcher/DEPLOY.sh +++ b/example/diameter/launcher/DEPLOY.sh @@ -2,9 +2,11 @@ # Functions & variables SETUPS_DIR=../../../source/diameter/stack/setups -MSGDTD_DIR=../../../source/diameter/codec/message.dtd +MSGDTD=../../../include/anna/diameter/codec/message.dtd +DCTDTD=../../../include/anna/diameter/stack/dictionary.dtd BASE_PROT=commands_baseProtocol.xml -EXEC=/opt/bin/anna/example_diameter_launcher +#EXEC=/opt/bin/anna/example_diameter_launcher +EXEC=./debug/example_diameter_launcher DPATH_dflt=$HOME/ADL _exit () { @@ -16,50 +18,45 @@ _exit () { createRunScript () { -echo "#!/bin/ksh" > run.sh -echo "EXE=\`cat .exe 2>/dev/null\`" >> run.sh -echo "STARTED=\`ps -fea | grep \"\$EXE\" | grep -v grep\`" >> run.sh -echo "[ \"\$EXE\" != \"\" -a \"\$STARTED\" != \"\" ] && { echo \"Already started!\"; echo \"\$STARTED\" ; exit ; }" >> run.sh -echo "pre-start.sh" >> run.sh -echo "> launcher.traces" >> run.sh -echo "EXE=\"ndl_\`date '+%Y%m%d%H%M%S'\`\"" >> run.sh -echo "echo \$EXE > .exe" >> run.sh -#echo "rm \$EXE 2>/dev/null" >> run.sh -echo "echo ; echo \"Executable paths:\" ; echo" >> run.sh -echo "for i in \`ls execs/.*/*\` ; do echo \$i ; done" >> run.sh -echo "echo ; echo \"Input the executable path:\" ; read path ; while test \"\$path\" = \"\" ; do read path ; done" >> run.sh -echo "ln -s \$path \$EXE" >> run.sh -echo >> run.sh -echo -n "\$EXE " >> run.sh -for i in `cat args.txt | grep -v "^#"` -do - echo -n "$i " >> run.sh -done -echo "&" >> run.sh -chmod a+x run.sh -rm args.txt + echo "#!/bin/ksh" > run.sh + echo "EXE=\`cat .exe 2>/dev/null\`" >> run.sh + echo "STARTED=\`ps -fea | grep \"\$EXE\" | grep -v grep\`" >> run.sh + echo "[ \"\$EXE\" != \"\" -a \"\$STARTED\" != \"\" ] && { echo \"Already started!\"; echo \"\$STARTED\" ; exit ; }" >> run.sh + echo "./pre-start.sh" >> run.sh + echo "> launcher.traces" >> run.sh + echo "EXE=\"./ADL-launcher\"" >> run.sh + echo "echo \$EXE > .exe" >> run.sh + echo >> run.sh + echo -n "\$EXE " >> run.sh + for i in `cat args.txt | grep -v "^#"` + do + echo -n "$i " >> run.sh + done + echo "&" >> run.sh + chmod a+x run.sh + rm args.txt } createDictionaryPaths () { for i in stacks/*commands*xml -do - stacks/dependence.sh $i >/dev/null - stack=`basename $i` - if test "$stack" != "$BASE_PROT" - then + do + stacks/dependence.sh $i >/dev/null + stack=`basename $i` + if test "$stack" != "$BASE_PROT" + then > .dictionary__${stack} for j in `cat ${i}.dep` do - echo "${j},\c" >> .dictionary__${stack} + echo -n "${j}," >> .dictionary__${stack} done echo "stacks/$BASE_PROT,stacks/${stack}" >> .dictionary__${stack} - fi -done + fi + done -# Default: -ln -s .dictionary__commands_qosControl.xml .dictionary + # Default: + ln -s .dictionary__commands_qosControl.xml .dictionary } ############# @@ -70,22 +67,26 @@ echo "---------------------------------------" echo "Anna Diameter Launcher (ADL) deployment" echo "---------------------------------------" echo -echo "Input deployment path [$DPATH_dftl]:" +echo "Input deployment path [$DPATH_dflt]:" read DPATH [[ "$DPATH" = "" ]] && DPATH=$DPATH_dflt -mkdir -p $DPATH -mkdir $DPATH/stacks +[[ -d $DPATH ]] && _exit "The path '$DPATH' already exists. Remove it before continue..." echo "Basic checkings ..." -[[ ! -f $EXEC ]] && salir "Anna Diameter Launcher (ADL) is not installed in the system. Execute 'sudo scons install' for 'anna' suite." -[[ ! -d $SETUPS_DIR ]] && salir "Diameter stacks not found ($SETUPS_DIR). Perhaps you executed '$0' out of its parent path." +#[[ ! -f $EXEC ]] && _exit "Anna Diameter Launcher (ADL) is not installed in the system. Execute 'sudo scons install' for 'anna' suite." +[[ ! -f $EXEC ]] && _exit "Anna Diameter Launcher (ADL) is not linked. Execute 'scons' for 'anna' suite." +[[ ! -d $SETUPS_DIR ]] && _exit "Diameter stacks not found ($SETUPS_DIR). Perhaps you executed this script out of its parent path." echo "Copying ..." -cp $EXEC $DPATH/launcher +mkdir -p $DPATH +mkdir -p $DPATH/stacks +cp $EXEC $DPATH/ADL-launcher cp resources/* $DPATH cp $SETUPS_DIR/*xml $DPATH/stacks cp $SETUPS_DIR/*sh $DPATH/stacks -cp $MSGDTD_DIR $DPATH +cp $SETUPS_DIR/readme.txt $DPATH/stacks +cp $MSGDTD $DPATH +cp $DCTDTD $DPATH echo "Preparing ..." cd $DPATH @@ -94,16 +95,11 @@ createDictionaryPaths cd - >/dev/null # Help: -echo "Stacks available at '.dictionary__', create a symbolic link from '.dictionary'." >> tmp/README -echo "Template for xml messages: message.dtd (informative, not actually required by process)" >> tmp/README -echo "Start with 'run.sh'" >> tmp/README - -mv tmp ADL-installer -tar cvfz ADL-installer.tar.gz ADL-installer -rm -rf ADL-installer - echo -echo "Created ADL-installer.tar.gz !" +echo "Go to '$DPATH' and see README file" +echo +echo "Done!" +echo echo