From a2485d6079bf98691cfcaa167ee6838355fe883b Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 2 Apr 2024 11:22:32 +0800 Subject: [PATCH] Script Refactoring --- scripts-new/lib/util.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts-new/lib/util.sh b/scripts-new/lib/util.sh index e94dbee22..8bbd2116c 100644 --- a/scripts-new/lib/util.sh +++ b/scripts-new/lib/util.sh @@ -2833,11 +2833,10 @@ function openim::util::find_ports_for_all_services() { check_binary_ports() { binary_path="$1" - binary_name=$(basename "$binary_path") # Check if the binary is running if pgrep -f "$binary_path" > /dev/null; then - echo "$binary_name is running." "arg $1" + # echo "$binary_name is running." "arg $1" # Find the PID(s) of the running binary pids=$(pgrep -f "$binary_path") @@ -2863,12 +2862,12 @@ check_binary_ports() { ports=$(echo "$ports" | xargs | tr ' ' '\n' | uniq | tr '\n' ' ') if [ -z "$ports" ]; then - echo "$binary_name is not listening on any ports." + echo "$binary_path is not listening on any ports." else - echo "$binary_name is listening on the following ports: $ports" + echo "$binary_path is listening on the following ports: $ports" fi else - echo "$binary_name is not running." + echo "$binary_path is not running." fi }