#!/bin/bash
-> curl_log.txt
-TRACE="--trace-ascii curl_log.txt"
-SERVER=`cat .httpServer`
-
echo
echo
-echo "Use: $0 [xml_file] [2e]"
+echo "Use: $0 [json file for REST API] [2e]"
echo
-echo "Programm 'xml_file' answer to the diameter client or to the server (entity) when"
+echo "Program answer to the diameter client or to the server (entity) when"
echo "'2e' parameter is provided. If missing xml file, current programmed answers will"
echo "be shown: '$0' (answers to client), '$0 2e' (answers to server)."
echo
if test "$1" = "2e"
then
operation="answerxml2e"
- else
+ else
[[ ! -f "$1" ]] && { echo "ERROR: file '$1' not found" ; echo; echo; exit ; }
operation="answerxml|$1"
[[ "$2" = "2e" ]] && operation="answerxml2e|$1"
operation="answerxml"
fi
echo
-curl -m 1 --data "$operation" $TRACE ${SERVER}
-
+./operation.sh "$operation"