#!/usr/bin/env bash # Stop MoneyFlix lab services set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" PID_DIR="$ROOT/tools/lab/.pids" for name in crm redirector; do pidfile="$PID_DIR/$name.pid" if [[ -f "$pidfile" ]]; then pid="$(cat "$pidfile")" if kill -0 "$pid" 2>/dev/null; then kill "$pid" 2>/dev/null || true echo "Stopped $name (pid $pid)" fi rm -f "$pidfile" fi done