From f360a4a2b02db65db4121ebb55348605b999486c Mon Sep 17 00:00:00 2001 From: Himanshu Verma Date: Thu, 23 Apr 2026 10:31:23 +0530 Subject: [PATCH] fix(server): fix check_port port extraction for schemeless URLs --- hugegraph-pd/hg-pd-dist/src/assembly/static/bin/util.sh | 2 +- hugegraph-server/hugegraph-dist/src/assembly/static/bin/util.sh | 2 +- hugegraph-store/hg-store-dist/src/assembly/static/bin/util.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hugegraph-pd/hg-pd-dist/src/assembly/static/bin/util.sh b/hugegraph-pd/hg-pd-dist/src/assembly/static/bin/util.sh index 5cc0c355be..0b7ad0f0f0 100644 --- a/hugegraph-pd/hg-pd-dist/src/assembly/static/bin/util.sh +++ b/hugegraph-pd/hg-pd-dist/src/assembly/static/bin/util.sh @@ -83,7 +83,7 @@ function process_id() { # check the port of rest server is occupied function check_port() { - local port=`echo $1 | awk -F':' '{print $3}'` + local port=$(echo "$1" | sed 's|.*:||' | sed 's|/.*||') if ! command_available "lsof"; then echo "Required lsof but it is unavailable" exit 1 diff --git a/hugegraph-server/hugegraph-dist/src/assembly/static/bin/util.sh b/hugegraph-server/hugegraph-dist/src/assembly/static/bin/util.sh index 11979b6481..e2655c69d3 100755 --- a/hugegraph-server/hugegraph-dist/src/assembly/static/bin/util.sh +++ b/hugegraph-server/hugegraph-dist/src/assembly/static/bin/util.sh @@ -81,7 +81,7 @@ function process_id() { # check the port of rest server is occupied function check_port() { - local port=$(echo "$1" | awk -F':' '{print $3}') + local port=$(echo "$1" | sed 's|.*:||' | sed 's|/.*||') if ! command_available "lsof"; then echo "Required lsof but it is unavailable" exit 1 diff --git a/hugegraph-store/hg-store-dist/src/assembly/static/bin/util.sh b/hugegraph-store/hg-store-dist/src/assembly/static/bin/util.sh index 93b55311cb..3b3d660102 100644 --- a/hugegraph-store/hg-store-dist/src/assembly/static/bin/util.sh +++ b/hugegraph-store/hg-store-dist/src/assembly/static/bin/util.sh @@ -82,7 +82,7 @@ function process_id() { # check the port of rest server is occupied function check_port() { - local port=`echo $1 | awk -F':' '{print $3}'` + local port=$(echo "$1" | sed 's|.*:||' | sed 's|/.*||') if ! command_available "lsof"; then echo "Required lsof but it is unavailable" exit 1