3924f73af35d35d917adf00a44eee0ac9390660a
[anna.git] / example / diameter / launcher / deployments / advanced / decode.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 <hex_file>"
9    echo
10    echo "Creates '<hex_file>.xml' with decoded result."
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="decode|$1|${1}.xml"
20 curl -m 1 --data "$operation" $TRACE ${SERVER}
21