Created
March 20, 2020 20:51
-
-
Save gfodor/c219899e8225a4fb4cb71b4adf068291 to your computer and use it in GitHub Desktop.
Script to update CORS proxy worker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
HOST=$1 | |
TOKEN=$2 | |
WORKER=$3 | |
# Usage examples: | |
# | |
# Enable worker: | |
# set_worker.sh "hubs.ieeevr.online" "<auth token>" "workerdomain.com" | |
# Disable worker: | |
# set_worker.sh "hubs.ieeevr.online" "<auth token>" "" | |
curl -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -XPATCH -d "{ \"phx\": { \"cors_proxy_url_host\": \"$WORKER\" } }" "https://$HOST/api/ita/configs/reticulum" | |
curl -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -XPATCH -d "{ \"general\": { \"cors_proxy_server\": \"$WORKER\" } }" "https://$HOST/api/ita/configs/hubs" | |
curl -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -XPATCH -d "{ \"general\": { \"cors_proxy_server\": \"$WORKER\" } }" "https://$HOST/api/ita/configs/spoke" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment