From 104d77724a78183690b5fe280bca4aeff13077cf Mon Sep 17 00:00:00 2001 From: shocknet-justin Date: Thu, 25 Sep 2025 12:46:15 -0400 Subject: [PATCH] use lsof for ports --- scripts/ports.sh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/scripts/ports.sh b/scripts/ports.sh index 223d21e0..bd435321 100644 --- a/scripts/ports.sh +++ b/scripts/ports.sh @@ -22,11 +22,5 @@ find_available_port() { # @return 0 if the port is available, 1 otherwise. is_port_available() { local port=$1 - if [[ "$OS" == "Mac" ]]; then - # Use lsof on macOS - ! lsof -iTCP:"$port" -sTCP:LISTEN -P -t >/dev/null - else - # Use ss on Linux - ! ss -lntu | awk '{print $5}' | grep -q ":$port$" - fi + ! lsof -iTCP:"$port" -sTCP:LISTEN -P -t >/dev/null 2>&1 }