fix(provision): reconcile channel pricing and hosted access
This commit is contained in:
@@ -150,10 +150,13 @@ PY
|
||||
)"
|
||||
|
||||
if RESP_EXISTING_HOST="$(curl_json GET "/api/hosts/$HOST_NAME" 2>/dev/null)"; then
|
||||
RESP_CREATE_HOST="$RESP_EXISTING_HOST"
|
||||
else
|
||||
RESP_CREATE_HOST="$(curl_json POST /api/hosts "$CREATE_HOST_PAYLOAD")"
|
||||
EXISTING_BASE_URL="$(printf '%s' "$RESP_EXISTING_HOST" | json_get base_url || true)"
|
||||
if [[ -n "$EXISTING_BASE_URL" && "$EXISTING_BASE_URL" != "$HOST_BASE_URL" ]]; then
|
||||
echo "existing host $HOST_NAME points to $EXISTING_BASE_URL, expected $HOST_BASE_URL" >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
RESP_CREATE_HOST="$(curl_json POST /api/hosts "$CREATE_HOST_PAYLOAD")"
|
||||
save_json 01-create-host "$RESP_CREATE_HOST"
|
||||
HOST_ID="$(printf '%s' "$RESP_CREATE_HOST" | json_get host_id || true)"
|
||||
HOST_ID="${HOST_ID:-$HOST_NAME}"
|
||||
|
||||
Reference in New Issue
Block a user