projects
/
anna.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
simplify
[anna.git]
/
example
/
diameter
/
launcher
/
DEPLOY.sh
diff --git
a/example/diameter/launcher/DEPLOY.sh
b/example/diameter/launcher/DEPLOY.sh
index
eaec5b3
..
7f53a99
100755
(executable)
--- a/
example/diameter/launcher/DEPLOY.sh
+++ b/
example/diameter/launcher/DEPLOY.sh
@@
-7,8
+7,10
@@
SETUPS_DIR=../../../source/diameter/stack/setups
MSGDTD=../../../include/anna/diameter/codec/message.dtd
DCTDTD=../../../include/anna/diameter/stack/dictionary.dtd
BASE_PROT=commands_baseProtocol.xml
MSGDTD=../../../include/anna/diameter/codec/message.dtd
DCTDTD=../../../include/anna/diameter/stack/dictionary.dtd
BASE_PROT=commands_baseProtocol.xml
-EXEC=./debug/example_diameter_launcher
-DPATH_dflt=$HOME/ADL
+
+# Executables in priority order:
+EXEC_installed=/opt/bin/anna/example_diameter_launcher
+EXECS=( $EXEC_installed ./release/example_diameter_launcher ./debug/example_diameter_launcher )
#############
# FUNCTIONS #
#############
# FUNCTIONS #
@@
-78,14
+80,15
@@
echo "---------------------------------------"
echo "Anna Diameter Launcher (ADL) deployment"
echo "---------------------------------------"
echo
echo "Anna Diameter Launcher (ADL) deployment"
echo "---------------------------------------"
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..."
-
echo "Basic checkings ..."
echo "Basic checkings ..."
-[ ! -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."
+available=
+for EXEC in ${EXECS[@]}; do
+ echo -n "Looking executable at '$EXEC' ... "
+ [ -x $EXEC ] && { available=yes ; echo "available !" ; break ; }
+ echo "not found"
+done
+[ -z "$available" ] && _exit "Anna Diameter Launcher (ADL) is not installed neither linked. See README.md (Install section)."
+[ ! -d $SETUPS_DIR ] && _exit "Diameter stacks not found ($SETUPS_DIR)."
echo
echo "Deploy one of these versions:"
echo
echo "Deploy one of these versions:"
@@
-99,15
+102,18
@@
read option
[ "$option" = "" ] && option=b
case $option in
a)
[ "$option" = "" ] && option=b
case $option in
a)
- RESOURCES_DIR=resources/advanced
+ DEPLOYMENTS_DIR=deployments/advanced
+ DPATH_dflt=$HOME/ADL-advanced
;;
b)
;;
b)
- RESOURCES_DIR=resources/basic
+ DEPLOYMENTS_DIR=deployments/basic
+ DPATH_dflt=$HOME/ADL-basic
;;
f)
;;
f)
- RESOURCES_DIR=resources/ft-client
+ DEPLOYMENTS_DIR=deployments/ft-client
+ DPATH_dflt=$HOME/ADL-ft-client
;;
*)
;;
*)
@@
-115,13
+121,26
@@
case $option in
;;
esac
;;
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..."
+
echo "Copying ..."
mkdir -p $DPATH
mkdir -p $DPATH/stacks
mkdir -p $DPATH/DTDs
mkdir -p $DPATH/counters
echo "Copying ..."
mkdir -p $DPATH
mkdir -p $DPATH/stacks
mkdir -p $DPATH/DTDs
mkdir -p $DPATH/counters
-cp $EXEC $DPATH/ADL-launcher
-cp -rL $RESOURCES_DIR/* $DPATH
+mkdir -p $DPATH/resources
+if [ "$EXEC" = "$EXEC_installed" ]
+then
+ ln -s $EXEC_installed $DPATH/ADL-launcher
+else
+ cp $EXEC $DPATH/ADL-launcher
+fi
+cp -rL $DEPLOYMENTS_DIR/* $DPATH
+cp resources/* $DPATH/resources
cp $SETUPS_DIR/*xml $DPATH/stacks
cp $SETUPS_DIR/*sh $DPATH/stacks
cp $SETUPS_DIR/readme.txt $DPATH/stacks
cp $SETUPS_DIR/*xml $DPATH/stacks
cp $SETUPS_DIR/*sh $DPATH/stacks
cp $SETUPS_DIR/readme.txt $DPATH/stacks