2020-07-22 08:05:30 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
source .env
|
|
|
|
|
2022-06-05 09:41:00 +00:00
|
|
|
TOKEN=$(
|
|
|
|
go run cmd/signjwt/*.go \
|
|
|
|
--expires-in 1m \
|
|
|
|
--vendor-id "$VENDOR_ID" \
|
|
|
|
--secret "$MGMT_SECRET" \
|
|
|
|
--machine-ppid "$MGMT_SECRET"
|
2020-07-22 08:05:30 +00:00
|
|
|
)
|
|
|
|
echo "MGMT_TOKEN: $TOKEN"
|
|
|
|
|
|
|
|
my_parts=$(
|
2022-06-05 09:41:00 +00:00
|
|
|
go run cmd/signjwt/*.go \
|
|
|
|
--vendor-id "$VENDOR_ID" \
|
|
|
|
--secret "$MGMT_SECRET" \
|
|
|
|
--machine-ppid "$MGMT_SECRET" \
|
|
|
|
--machine-ppid-only
|
2020-07-22 08:05:30 +00:00
|
|
|
)
|
|
|
|
my_ppid=$(echo $my_parts | cut -d' ' -f1)
|
|
|
|
my_keyid=$(echo $my_parts | cut -d' ' -f2)
|
|
|
|
echo "PPID (Priv): $my_ppid KeyID (Pub): $my_keyid"
|