#!/bin/bash # Stop all unified AGI subsystems SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PID_DIR="${SCRIPT_DIR}/pids" echo "[UNIFIED] Stopping all subsystems..." for pidfile in "${PID_DIR}"/*.pid; do if [ -f "$pidfile" ]; then pid=$(cat "$pidfile") name=$(basename "$pidfile" .pid) if kill -0 "$pid" 2>/dev/null; then echo "[UNIFIED] Stopping $name (PID: $pid)" kill "$pid" 2>/dev/null || true fi rm -f "$pidfile" fi done echo "[UNIFIED] All subsystems stopped."