refactor(scripts): quotes and spaces
This commit is contained in:
parent
a7f1398ba4
commit
f2d2af3761
|
@ -1,3 +1,7 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
set -u
|
||||||
|
|
||||||
source .env
|
source .env
|
||||||
|
|
||||||
# 1. (srv) create a new shared key for a given slug
|
# 1. (srv) create a new shared key for a given slug
|
||||||
|
@ -6,12 +10,14 @@ source .env
|
||||||
# 4. (dev) use key to connect to remote
|
# 4. (dev) use key to connect to remote
|
||||||
# 5. (dev) ping occasionally
|
# 5. (dev) ping occasionally
|
||||||
|
|
||||||
TOKEN=$(go run cmd/signjwt/*.go \
|
TOKEN="$(
|
||||||
|
go run cmd/signjwt/*.go \
|
||||||
--expires-in 1m \
|
--expires-in 1m \
|
||||||
--vendor-id "$VENDOR_ID" \
|
--vendor-id "$VENDOR_ID" \
|
||||||
--secret "$RELAY_SECRET" \
|
--secret "$RELAY_SECRET" \
|
||||||
--machine-ppid "$RELAY_SECRET"
|
--machine-ppid "$RELAY_SECRET"
|
||||||
)
|
)"
|
||||||
|
echo "${TOKEN}"
|
||||||
|
|
||||||
MGMT_URL=${MGMT_URL:-"http://mgmt.example.com:6468/api"}
|
MGMT_URL=${MGMT_URL:-"http://mgmt.example.com:6468/api"}
|
||||||
|
|
||||||
|
@ -19,4 +25,4 @@ CLIENT_SUBJECT=${CLIENT_SUBJECT:-"newbie"}
|
||||||
curl -X POST "$MGMT_URL/devices" \
|
curl -X POST "$MGMT_URL/devices" \
|
||||||
-H "Authorization: Bearer ${TOKEN}" \
|
-H "Authorization: Bearer ${TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d '{ "slug": "'$CLIENT_SUBJECT'" }'
|
-d '{ "slug": "'"$CLIENT_SUBJECT"'" }'
|
||||||
|
|
Loading…
Reference in New Issue