Compare commits
No commits in common. "a50c9c924c8bf10ccecf4eb55147db5f7585b93c" and "ffef8f66d26e3a8601208d93871600e02e035222" have entirely different histories.
a50c9c924c
...
ffef8f66d2
1 changed files with 4 additions and 12 deletions
16
requests.sh
16
requests.sh
|
@ -1,11 +1,11 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
ACTION=$1
|
ACTION=$1
|
||||||
VALUE=$2
|
TOKEN=$2
|
||||||
ACTIONS=(login register rcvpw username data csv)
|
ACTIONS=(login register rcvpw username)
|
||||||
|
|
||||||
print_help(){
|
print_help(){
|
||||||
echo "Usage: $0 ACTION [TOKEN|INPUT_TYPE]"
|
echo "Usage: $0 ACTION [TOKEN]"
|
||||||
echo
|
echo
|
||||||
echo "available actions:"
|
echo "available actions:"
|
||||||
for el in "${ACTIONS[@]}"; do
|
for el in "${ACTIONS[@]}"; do
|
||||||
|
@ -34,15 +34,7 @@ case $ACTION in
|
||||||
;;
|
;;
|
||||||
"${ACTIONS[3]}") # get current username
|
"${ACTIONS[3]}") # get current username
|
||||||
echo "get username action"
|
echo "get username action"
|
||||||
curl localhost:5050/api/username -X GET -H "Authorization: Bearer $VALUE"
|
curl localhost:5050/api/username -X GET -H "Authorization: Bearer $TOKEN"
|
||||||
;;
|
|
||||||
"${ACTIONS[4]}") # get all data from behametricsserver
|
|
||||||
echo "get data action"
|
|
||||||
curl localhost:5000/data
|
|
||||||
;;
|
|
||||||
"${ACTIONS[5]}") # get all data from behametricsserver
|
|
||||||
echo "get data action"
|
|
||||||
curl localhost:5000/data/csv/"${VALUE}"
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Error: Action not available"
|
echo "Error: Action not available"
|
||||||
|
|
Loading…
Reference in a new issue