#!/usr/bin/env bash
# Stop lab gameplay synth on this hop and restore fixture-prod.
set -euo pipefail
pkill -f pog422_fixture_bridge 2>/dev/null || true
pkill -f pog422_uartd 2>/dev/null || true
sleep 1
ENVF=~/EtherGold/fixture-bridge.env
if [[ -f "$ENVF" ]]; then
  sed -i '/^LAB_GAMEPLAY_SYNTH=/d' "$ENVF" 2>/dev/null || true
  echo 'LAB_GAMEPLAY_SYNTH=0' >>"$ENVF"
fi
sudo systemctl start fixture-prod 2>/dev/null || true
sleep 2
echo "restored fixture-prod host=$(hostname)"
systemctl is-active fixture-prod 2>/dev/null || true
pgrep -af 'pog422_fixture_bridge' | head -2 || true
