#!/bin/bash set -euo pipefail cd "$(dirname "${BASH_SOURCE[0]}")" # Stop launchd service (if loaded) if launchctl list | grep -q "com.nanoclaw"; then echo "Stopping via launchctl..." launchctl unload ~/Library/LaunchAgents/com.nanoclaw.plist 2>/dev/null || true fi # Kill direct node process running nanoclaw PIDS=$(pgrep -f "node.*dist/index.js" 2>/dev/null || true) if [ -n "$PIDS" ]; then echo "Killing node processes: $PIDS" echo "$PIDS" | xargs kill 2>/dev/null || true fi echo "Stopped."