System test feature
[anna.git] / example / diameter / launcher / DEPLOY_setups.sh
diff --git a/example/diameter/launcher/DEPLOY_setups.sh b/example/diameter/launcher/DEPLOY_setups.sh
new file mode 100755 (executable)
index 0000000..3457bbf
--- /dev/null
@@ -0,0 +1,75 @@
+#!/bin/sh
+
+#############
+# VARIABLES #
+#############
+DEPLOY_SCR=`dirname $0`/DEPLOY.sh
+
+#############
+# FUNCTIONS #
+#############
+_exit() {
+  echo
+  echo $1
+  echo
+  exit 1
+}
+
+#############
+# EXECUTION #
+#############
+echo
+echo "Which one you want to deploy [1]:"
+echo
+echo "   1. Client and server"
+echo "   2. Ft-client and server"
+echo
+read type
+[ "$type" = "" ] && type=1
+
+case $type in
+  1)
+    DEPLOY_DIR__dflt=$HOME/ADML-clientAndServer
+  ;;
+
+  2)
+    DEPLOY_DIR__dflt=$HOME/ADML-ftclientAndServer
+  ;;
+
+  *)
+    echo "Unknown option!"
+    exit 1
+  ;;
+esac
+
+echo
+echo "Directory for deploy [$DEPLOY_DIR__dflt]:"
+read DIR
+[ "$DIR" = "" ] && DIR=$DEPLOY_DIR__dflt
+[ -d $DIR ] && _exit "The directory '$DIR' already exists !"
+
+case $type in
+  1)
+    $DEPLOY_SCR b $DIR/client
+    $DEPLOY_SCR b $DIR/server
+    cd $DIR/client
+    echo c | ./configure.sh
+    cd - >/dev/null
+    cd $DIR/server
+    echo s | ./configure.sh
+    cd - >/dev/null
+  ;;
+
+  2)
+    $DEPLOY_SCR f $DIR/ft-client
+    $DEPLOY_SCR b $DIR/server
+    cd $DIR/server
+    echo s | ./configure.sh
+    cd - >/dev/null
+  ;;
+esac
+
+echo
+echo "Done!"
+echo
+