This is an automated email from the ASF dual-hosted git repository.

jshao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino-playground.git


The following commit(s) were added to refs/heads/main by this push:
     new b188e60  Fix port check issue (#89)
b188e60 is described below

commit b188e60450f2180e9a08b83b8ceaff8788429d3e
Author: danhuawang <[email protected]>
AuthorDate: Mon Oct 28 12:15:16 2024 +0800

    Fix port check issue (#89)
---
 playground.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/playground.sh b/playground.sh
index 990d5bc..2144453 100755
--- a/playground.sh
+++ b/playground.sh
@@ -47,9 +47,9 @@ checkCompose() {
 checkPortInUse() {
   local port=$1
   if [[ "$(uname)" == "Darwin" ]]; then
-    openPort=$(lsof -i :$port)
+    openPort=$(lsof -i :$port -sTCP:LISTEN)
   elif [[ "$(uname)" == "Linux" ]]; then
-    openPort=$(sudo lsof -i :$port)
+    openPort=$(sudo lsof -i :$port -sTCP:LISTEN)
   fi
   if [ -z "${openPort}" ]; then
     echo "Port $port is ok."

Reply via email to