Fork variant for TestStep command
[anna.git] / example / diameter / launcher / deployments / advanced / sendXml.sh
1 #!/bin/bash
2 > curl_log.txt
3 TRACE="--trace-ascii curl_log.txt"
4 SERVER=`cat .httpServer`
5
6 use () {
7
8    echo "Use: $0 <xml_file> [2c]"
9    echo
10    echo "Sends 'xml_file' to the diameter server or to the client when '2c' parameter is provided."
11    echo
12    exit
13 }
14
15 echo
16 [[ "$1" = "" ]] && use
17 [[ ! -f "$1" ]] && { echo "ERROR: file '$1' not found" ; echo; echo; exit ; }
18 echo
19 operation="sendxml|$1"
20 [[ "$2" = "2c" ]] && operation="sendxml2c|$1"
21
22 curl -m 1 --data "$operation" $TRACE ${SERVER}
23