telebit/examples/mgmt-ping-as-client.sh

20 lines
373 B
Bash
Raw Normal View History

2020-07-19 08:16:11 +00:00
#!/bin/bash
set -e
set -u
source .env
2020-07-22 08:05:30 +00:00
MGMT_URL="${MGMT_URL:-"http://localhost:3000/api"}"
2020-07-19 08:16:11 +00:00
2020-07-22 08:05:30 +00:00
TOKEN=$(go run cmd/signjwt/*.go \
--expires-in 1m \
--vendor-id "$VENDOR_ID" \
--secret "$CLIENT_SECRET"
)
2020-07-19 08:16:11 +00:00
2020-07-22 08:05:30 +00:00
echo "$MGMT_URL"
curl -X POST "$MGMT_URL/ping" -H "Authorization: Bearer ${TOKEN}"
echo ""
2020-07-22 08:05:30 +00:00
curl "$MGMT_URL/inspect" -H "Authorization: Bearer ${TOKEN}"
echo ""