Files
AzerothAI/deploy/playable/set-gm-credentials.sh
T
Richard Clark 5f0fc86cf9
Core tests / core (push) Successful in 9m57s
Full verification / application (push) Failing after 5m16s
Full verification / local-brain (push) Failing after 6m15s
Realm simulation / simulated-live-world (push) Failing after 5m32s
WoW integration lab / real-worldserver (push) Canceled after 17m23s
Import verified AzerothAI snapshot from GitHub
Source branch: feature/ai-brain-router
Source commit: c2a09e0460465201a58aaab56c71424e9a96405e
2026-09-22 13:12:54 -04:00

39 lines
1.1 KiB
Bash

#!/usr/bin/env bash
set -euo pipefail
if [[ "$#" -ne 2 ]]; then
echo "Usage: bash deploy/playable/set-gm-credentials.sh <USERNAME> <PASSWORD>" >&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."