Dynamic lib selection and deployment
[anna.git] / example / diameter / launcher / resources / scripts / select_dynlib.sh
diff --git a/example/diameter/launcher/resources/scripts/select_dynlib.sh b/example/diameter/launcher/resources/scripts/select_dynlib.sh
new file mode 100755 (executable)
index 0000000..40a0072
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/bash
+echo
+echo "------------------------------------------------"
+echo "Dynamic library selection for launcher procedure"
+echo "------------------------------------------------"
+cd $(dirname $0)
+option=$1
+rm -f libanna_dynamicLauncherProcedure.so
+if [ -z "$option" ]
+then
+  echo " (you could provide directly the path to the .so file)"
+  echo
+  echo "Available options:"
+  tmpfile=$(mktemp)
+  find . -name "*.so" > $tmpfile
+  echo
+  for line in $(cat $tmpfile); do echo "   $line" ; done
+  dflt=$(grep "^./default/" $tmpfile)
+  echo
+  echo -n "Paste your selection [$dflt]: "
+  read option
+  [ -z "$option" ] && option=$dflt
+  rm $tmpfile 
+fi
+
+[ ! -f $option ] && { echo -e "\nInvalid file !\n" ; exit 1 ; }
+ln -sf $option libanna_dynamicLauncherProcedure.so  
+echo
+echo "Library enabled"
+echo
+