improvs.
[anna.git] / example / diameter / launcher / deployments / st-client / program.sh
index 54b99ae..b000f8d 100755 (executable)
@@ -14,9 +14,7 @@ PROGRAM_LAYOUT_FILE=.st_conf_n_testcases_program_layout
 # FUNCTIONS #
 #############
 _exit() {
-  echo
-  echo $1
-  echo
+  echo -e "\n$1\n"
   exit 1
 }
 
@@ -183,7 +181,7 @@ else
   TESTCASE_DIR=$(readlink -f dynlibs/libanna_dynamicLauncherProcedure.so | xargs dirname)
   DYNAMIC_SUFFIX_FILE=$TESTCASE_DIR/dynamic.suffix
 
-  [ ! -f $DYNAMIC_SUFFIX_FILE ] && _exit "Missing '$DYNAMIC_SUFFIX_FILE' file. Use 'dynlibs/select.sh' to change the dynamic procedure and restart the ADML instances."
+  [ ! -f $DYNAMIC_SUFFIX_FILE ] && _exit "Missing '$DYNAMIC_SUFFIX_FILE' file.\nUse 'dynlibs/select.sh' to change the dynamic procedure and restart the ADML instances."
   dynamic_suffix=( $(grep -v ^# $DYNAMIC_SUFFIX_FILE) )
 
   # Multiple scenarios:
@@ -206,11 +204,20 @@ else
     done > $tmpfile
     cat $tmpfile
     echo
-    echo "Select the desired option:"
+    echo "Select the desired option (0 to input a user defined one):"
     read option
     while [ -z "$option" ]; do read option ; done
-    dynamic_suffix=$(grep "^${option}) " $tmpfile | cut -d" " -f2-)
-    [ -z "$dynamic_suffix" ] && _exit "Invalid option !"
+    if [ "$option" != "0" ]
+    then
+      dynamic_suffix=$(grep "^${option}) " $tmpfile | cut -d" " -f2-)
+      [ -z "$dynamic_suffix" ] && _exit "Invalid option !"
+    else
+      echo "Input specific program arguments:"
+      echo " (be sure that are supported by the dynamic procedure)"
+      echo
+      read dynamic_suffix
+      while [ -z "$dynamic_suffix" ]; do read dynamic_suffix ; done
+    fi
   fi
 
   # Modify xml files path: