#!/bin/bash PORT="${LISTEN_ADDR:-:8081}" PORT="${PORT#:}" PID=$(lsof -ti:$PORT) if [ -z "$PID" ]; then echo "Server is not running on port $PORT" exit 0 fi kill $PID echo "Server stopped (port $PORT, pid $PID)"