From 0e61c3acefde88a605340b84121b47fcecab33e2 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 19 Mar 2024 15:24:23 +0800 Subject: [PATCH] scripts for Mac --- scripts/lib/util.sh | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/scripts/lib/util.sh b/scripts/lib/util.sh index 993ddcae1..dcce56c12 100755 --- a/scripts/lib/util.sh +++ b/scripts/lib/util.sh @@ -397,7 +397,7 @@ openim::util::check_process_names() { return 1 fi } - + # Arrays to collect details of processes local not_started=() local started=() @@ -413,11 +413,7 @@ openim::util::check_process_names() { else # If there are PIDs, loop through each one for pid in "${pids[@]}"; do - echo aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa local command=$(ps -p $pid -o comm=) - - echo "ps -p $pid -o comm=" - local start_time=$(ps -p $pid -o lstart=) local port=$(get_port $pid) @@ -427,12 +423,11 @@ openim::util::check_process_names() { fi started+=("Process $process_name - Command: $command, PID: $pid, Port: $port, Start time: $start_time") - echo bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb $started done fi done - + # Print information if [[ ${#not_started[@]} -ne 0 ]]; then echo "Not started processes:" @@ -440,7 +435,7 @@ openim::util::check_process_names() { echo "Process $process_name is not started." done fi - + if [[ ${#started[@]} -ne 0 ]]; then echo echo "Started processes:" @@ -448,7 +443,7 @@ openim::util::check_process_names() { echo "$info" done fi - + # Return status if [[ ${#not_started[@]} -ne 0 ]]; then openim::color::echo $COLOR_RED "OpenIM Stdout Log >> cat ${LOG_FILE}" @@ -494,7 +489,7 @@ openim::util::check_process_names_for_stop() { else # If there are PIDs, loop through each one for pid in "${pids[@]}"; do - local command=$(ps -p $pid -o cmd=) + local command=$(ps -p $pid -o comm=) local start_time=$(ps -p $pid -o lstart=) local port=$(get_port $pid)