#!/bin/bash set -euo pipefail echo "🚑 Healing ports..." lsof -nP -iTCP -sTCP:LISTEN | awk 'NR>1{print $2}' | sort -u | while read -r PID; do CMD="$(ps -o comm= -p "$PID" 2>/dev/null || true)" case "$CMD" in *python*|*uvicorn*|*node*) echo "🔪 Killing $CMD (PID $PID)"; kill -9 "$PID" || true ;; esac done echo "✅ Ports healed."