From 31077bd2c4834a4e059689f0964e8fc1dee1b0a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Hauser?= Date: Wed, 1 May 2024 15:53:47 +0200 Subject: [PATCH] feat: use `ss -tulnp | grep ':PORT '` instead of `lsof -i :PORT` On GCP instances lsof -i gives false positive about port usage. Using ss -tulnp fixes this --- docker/prod.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/prod.sh b/docker/prod.sh index 6408807d..caafe960 100644 --- a/docker/prod.sh +++ b/docker/prod.sh @@ -19,13 +19,13 @@ if [ -f /.dockerenv ]; then fi # check if something is running on port 80 -if lsof -i :80 >/dev/null; then +if ss -tulnp | grep ':80 ' >/dev/null; then echo "Error: something is already running on port 80" >&2 exit 1 fi # check if something is running on port 443 -if lsof -i :443 >/dev/null; then +if ss -tulnp | grep ':443 ' >/dev/null; then echo "Error: something is already running on port 443" >&2 exit 1 fi