Eclectic Media Git auto_bandwidth_test / 793c1ff
Added checks for JWT token, submit via curl to API Ariana Giroux 10 months ago
1 changed file(s) with 12 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
00 #! /bin/bash
1
2 if ! ls | grep 'mykey' &> /dev/null; then
3 echo "Keyfile is not present at './mykey'!" 2>&1
4 exit 1
5 fi
16
27 tput setaf 3
38 echo "Checking for required modules..."
3843 tput sgr0
3944
4045 jquery_string=$(jq -R -s -c 'split("\n")' < /tmp/iperf_out)
41 echo $jquery_string
46 curl -X PUT \
47 -H "Content-Type: application/json" \
48 -H "X-API-KEY: $(cat mykey)" \
49 -d "{\"data\":$jquery_string}" http://eclecticmedia.space:8029/
4250
51 echo ''
52 echo ''
53 echo 'DONE!'