#!/usr/bin/env bash set -euo pipefail if [[ "$#" -ne 2 ]]; then echo "Usage: bash deploy/playable/set-gm-credentials.sh " >&2 exit 2 fi USERNAME="$1" PASSWORD="$2" REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" DEV_VARS="$REPO_ROOT/.dev.vars" python3 - "$DEV_VARS" "$USERNAME" "$PASSWORD" <<'PY' from pathlib import Path import sys p=Path(sys.argv[1]) updates={"SOAP_USER":sys.argv[2],"SOAP_PASSWORD":sys.argv[3]} lines=p.read_text().splitlines() if p.exists() else [] out=[] seen=set() for line in lines: if "=" in line and not line.lstrip().startswith("#"): key=line.split("=",1)[0].strip() if key in updates: out.append(f"{key}={updates[key]}") seen.add(key) continue out.append(line) for key,value in updates.items(): if key not in seen: out.append(f"{key}={value}") p.write_text("\n".join(out).rstrip()+"\n") PY chmod 600 "$DEV_VARS" echo "Saved SOAP credentials to the ignored local .dev.vars file." echo "Restart AzerothAI so the GM console picks them up."