From 242051395e3e103905f96fd7b8f5c6f55266ada9 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Mon, 20 Jul 2020 16:21:27 -0600 Subject: [PATCH] add example for removing device --- examples/remove-active-device.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 examples/remove-active-device.sh diff --git a/examples/remove-active-device.sh b/examples/remove-active-device.sh new file mode 100644 index 0000000..b598f3b --- /dev/null +++ b/examples/remove-active-device.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -e +set -u + +source .env +TUNNEL_RELAY_API="${TUNNEL_RELAY_API:-"https://devices.example.com/api"}" + +echo "RELAY_SECRET: $RELAY_SECRET" +TOKEN=$(go run cmd/signjwt/*.go \ + --vendor-id "$VENDOR_ID" \ + --secret "$RELAY_SECRET" \ + --machine-ppid "$RELAY_SECRET" +) +echo "ADMIN TOKEN: '$TOKEN'" + +echo "Auth URL: $TUNNEL_RELAY_API" +curl -X DELETE "$TUNNEL_RELAY_API/subscribers/ruby" -H "Authorization: Bearer ${TOKEN}" +echo ""