Multistack launcher
[anna.git] / example / diameter / launcher / resources / scripts / operation_curl.sh
diff --git a/example/diameter/launcher/resources/scripts/operation_curl.sh b/example/diameter/launcher/resources/scripts/operation_curl.sh
new file mode 100755 (executable)
index 0000000..5cff3c7
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+#############
+# FUNCTIONS #
+#############
+_exit () {
+  echo -e "\n$1\n"
+  exit 1
+}
+
+#############
+# EXECUTION #
+#############
+cd `dirname $0`
+echo
+# Get the HTTP Server:
+[ ! -f .httpServer ] && _exit "Can't found '`pwd`/.httpServer' to use with curl tool."
+SERVER=`cat .httpServer`
+
+# Send operation:
+[ "$1" = "" ] && _exit "Usage: $0 <operation string>; i.e.: $0 help"
+#> curl_log.txt
+#TRACE="--trace-ascii curl_log.txt"
+curl -m 1 --data "$1" $SERVER
+