X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2FDEPLOY.sh;h=ceb04b17ac60f063ae26244c04cb01c75c861e45;hb=9cf0513932fb41804095983e065e48aee078dfc7;hp=7f53a993281f1b5c61a6820b740af2a9c8e37aab;hpb=b8d9d3d86c425cf545bbee4fa48522157a55c3bd;p=anna.git diff --git a/example/diameter/launcher/DEPLOY.sh b/example/diameter/launcher/DEPLOY.sh index 7f53a99..ceb04b1 100755 --- a/example/diameter/launcher/DEPLOY.sh +++ b/example/diameter/launcher/DEPLOY.sh @@ -19,9 +19,27 @@ _exit () { echo echo $1 echo - exit + exit 1 } +usage () { + echo "Usage: $0 [deployment_type: a|b|f] [deployment_path]" + echo + echo " deployment_type:" + echo " a=advanced" + echo " b=basic" + echo " f=function test client" + echo " deployment_path:" + echo " non-existent path directory." + echo + echo " For example:" + echo " $0 b $HOME/ADL/basicServer" + echo " $0 b $HOME/ADL/MMSbalancer" + echo " $0 f $HOME/ADL/tester" + echo + exit 0 +} + # $1: deployment type createRunScript () { @@ -37,10 +55,10 @@ EXE=$exe STARTED=\`pgrep \$EXE 2>/dev/null\` [ \$? -eq 0 ] && { echo "Already started!"; echo "\$STARTED" ; exit 1 ; } ./pre-start.sh -0> launcher.traces +0> launcher.trace rm -f counters/* # Execution line: -./\$EXE -cntDir counters $(for i in `cat args.txt | grep -v "^#"`; do echo -n "$i "; done)& +./\$EXE --cntDir counters $(for i in `cat args.txt | grep -v "^#"`; do echo -n "$i "; done)& echo \$! > .pid EOF @@ -79,6 +97,8 @@ echo echo "---------------------------------------" echo "Anna Diameter Launcher (ADL) deployment" echo "---------------------------------------" +[ "$1" = "--help" -o "$1" = "-h" ] && usage +echo " (--help or -h for more info)" echo echo "Basic checkings ..." available= @@ -91,43 +111,59 @@ done [ ! -d $SETUPS_DIR ] && _exit "Diameter stacks not found ($SETUPS_DIR)." echo -echo "Deploy one of these versions:" -echo -echo " (a)dvanced version: includes burst management script and templates for different scenarios. Automatic configuration during start." -echo " (b)asic version: 4 types of launcher (client, server, balancer, dummy), lightly configured and managed through SIGURS2 method." -echo " (f)unction test client: special client with regexp scheduler script based on splitted traffic logs." -echo -echo "Input option [b]:" -read option -[ "$option" = "" ] && option=b +if [ "$1" = "" ] +then + echo + echo "Deploy one of these versions:" + echo + echo " (a)dvanced version: includes burst management script and templates for different scenarios. Automatic configuration during start." + echo " (b)asic version: 4 types of launcher (client, server, balancer, dummy), lightly configured and managed through SIGURS2 method." + echo " (f)unction test client: special client with regexp scheduler script based on splitted traffic logs. Requires a server to perform the tests." + echo + echo "Input option [b]:" + read option + [ "$option" = "" ] && option=b +else + option=$1 +fi + case $option in a) + echo "Advanced deployment" DEPLOYMENTS_DIR=deployments/advanced DPATH_dflt=$HOME/ADL-advanced ;; b) + echo "Basic deployment" DEPLOYMENTS_DIR=deployments/basic DPATH_dflt=$HOME/ADL-basic ;; f) + echo "FT deployment" DEPLOYMENTS_DIR=deployments/ft-client DPATH_dflt=$HOME/ADL-ft-client ;; *) - _exit "Unknown option !!" + _exit "Invalid deployment type '$option' !!" ;; esac echo -echo "Input deployment path [$DPATH_dflt]:" -read DPATH -[ "$DPATH" = "" ] && DPATH=$DPATH_dflt -[ -d $DPATH ] && _exit "The path '$DPATH' already exists. Remove it before continue..." +if [ "$2" = "" ] +then + echo "Input deployment path [$DPATH_dflt]:" + read DPATH + [ "$DPATH" = "" ] && DPATH=$DPATH_dflt +else + DPATH=$2 +fi + +[ -d $DPATH ] && _exit "The installation path '$DPATH' must not exists." -echo "Copying ..." +echo "Copying to '$DPATH' ..." mkdir -p $DPATH mkdir -p $DPATH/stacks mkdir -p $DPATH/DTDs