From c5e4b6a772b8265764a88609d59f2e55cb084052 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Thu, 21 Mar 2024 17:37:15 +0800 Subject: [PATCH] Optimizing scripts --- scripts/lib/util.sh | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/scripts/lib/util.sh b/scripts/lib/util.sh index 3d8d91f88..75fe06cd0 100755 --- a/scripts/lib/util.sh +++ b/scripts/lib/util.sh @@ -2846,7 +2846,7 @@ function openim::util::check_process_names_for_stop() { } -function openim::util::find_process_ports2() { +function openim::util::find_process_ports() { local process_path="$1" if [[ -z "$process_path" ]]; then echo "Usage: find_process_ports /path/to/process" @@ -2862,17 +2862,6 @@ function openim::util::find_process_ports2() { done } -function openim::util::find_process_ports() { - local process_path="$1" - - local ports=$(lsof -Fn -iTCP -iUDP | grep -i listen | grep "$process_path" | awk -F'[>:]' '{print $(NF-1) " " $NF}' | sort -u | tr '\n' ' ') - - if [ -z "$ports" ]; then - echo "No listening ports found for the process." - else - echo "Listening on ports: $ports" - fi -} function openim::util::find_ports_for_all_services() {