diff options
Diffstat (limited to 'server/hack')
| -rwxr-xr-x | server/hack/rwgps-get-auth-token.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/server/hack/rwgps-get-auth-token.sh b/server/hack/rwgps-get-auth-token.sh new file mode 100755 index 0000000..d7a14a5 --- /dev/null +++ b/server/hack/rwgps-get-auth-token.sh | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | rwgps_api_key="$(jq <config.json '.rwgps.api_key' -r)" | ||
| 4 | |||
| 5 | echo -n "RWGPS account email: " | ||
| 6 | read rwgps_email | ||
| 7 | echo -n "RWGPS account password: " | ||
| 8 | read rwgps_password | ||
| 9 | |||
| 10 | jq -nc --arg email "$rwgps_email" --arg password "$rwgps_password" \ | ||
| 11 | '{"user": {"email": $email, "password": $password}}' \ | ||
| 12 | | curl --json @- -H "x-rwgps-api-key: $rwgps_api_key" \ | ||
| 13 | https://ridewithgps.com/api/v1/auth_tokens.json | ||
| 14 | echo | ||