diff --git a/requests.sh b/requests.sh index 6cfb89a..ee90262 100755 --- a/requests.sh +++ b/requests.sh @@ -1,11 +1,11 @@ #!/bin/bash ACTION=$1 -VALUE=$2 -ACTIONS=(login register rcvpw username data csv) +TOKEN=$2 +ACTIONS=(login register rcvpw username) print_help(){ - echo "Usage: $0 ACTION [TOKEN|INPUT_TYPE]" + echo "Usage: $0 ACTION [TOKEN]" echo echo "available actions:" for el in "${ACTIONS[@]}"; do @@ -34,15 +34,7 @@ case $ACTION in ;; "${ACTIONS[3]}") # get current username echo "get username action" - curl localhost:5050/api/username -X GET -H "Authorization: Bearer $VALUE" - ;; - "${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}" + curl localhost:5050/api/username -X GET -H "Authorization: Bearer $TOKEN" ;; *) echo "Error: Action not available"