From 0434fcee00baff421a157f41323837070eb33a2b Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Fri, 29 May 2026 08:35:39 -0400 Subject: [PATCH] chore(seed): name MxGateway connection per site (ScadaBridge Site ) Replace the generic 'MxGateway Shared' connection name with a per-site name (site-a -> 'ScadaBridge Site A', env2 site-x -> 'ScadaBridge Site X') in both docker/ and docker-env2/ seed scripts. --- docker-env2/seed-sites.sh | 7 ++++--- docker/seed-sites.sh | 9 ++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/docker-env2/seed-sites.sh b/docker-env2/seed-sites.sh index d3cb0163..b8542bfc 100755 --- a/docker-env2/seed-sites.sh +++ b/docker-env2/seed-sites.sh @@ -52,13 +52,14 @@ MXGW_CONFIG="{\"endpoint\":\"${MXGW_ENDPOINT}\",\"apiKey\":\"${MXGW_APIKEY}\",\" SITE_X_ID=$($CLI $URL $AUTH --format json site list \ | python3 -c "import sys,json; print(next((s['id'] for s in json.load(sys.stdin) if s.get('siteIdentifier')=='site-x'), ''))" 2>/dev/null) if [ -n "$SITE_X_ID" ]; then - echo " site-x (id=$SITE_X_ID): creating 'MxGateway Shared'..." + CONN_NAME="ScadaBridge Site X" + echo " site-x (id=$SITE_X_ID): creating '$CONN_NAME'..." $CLI $URL $AUTH data-connection create \ --site-id "$SITE_X_ID" \ - --name "MxGateway Shared" \ + --name "$CONN_NAME" \ --protocol "MxGateway" \ --primary-config "$MXGW_CONFIG" \ - || echo " (MxGateway connection may already exist on site-x)" + || echo " ('$CONN_NAME' may already exist on site-x)" else echo " (site-x not found — skipping MxGateway connection)" fi diff --git a/docker/seed-sites.sh b/docker/seed-sites.sh index 2139b347..fa5c7102 100755 --- a/docker/seed-sites.sh +++ b/docker/seed-sites.sh @@ -83,13 +83,16 @@ for ident in site-a site-b site-c; do echo " ($ident not found — skipping MxGateway connection)" continue fi - echo " $ident (id=$SITE_ID): creating 'MxGateway Shared'..." + # Per-site connection name (e.g. site-a -> "ScadaBridge Site A"). + SITE_LETTER=$(printf '%s' "${ident#site-}" | tr '[:lower:]' '[:upper:]') + CONN_NAME="ScadaBridge Site ${SITE_LETTER}" + echo " $ident (id=$SITE_ID): creating '$CONN_NAME'..." $CLI $URL $AUTH data-connection create \ --site-id "$SITE_ID" \ - --name "MxGateway Shared" \ + --name "$CONN_NAME" \ --protocol "MxGateway" \ --primary-config "$MXGW_CONFIG" \ - || echo " (MxGateway connection may already exist on $ident)" + || echo " ('$CONN_NAME' may already exist on $ident)" done echo ""