mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-03 02:42:19 +08:00
Optimize script logs
This commit is contained in:
parent
406228297e
commit
b85bb4ca4b
@ -409,20 +409,15 @@ openim::util::check_process_names() {
|
|||||||
|
|
||||||
# Check if any process IDs were found
|
# Check if any process IDs were found
|
||||||
if [[ ${#pids[@]} -eq 0 ]]; then
|
if [[ ${#pids[@]} -eq 0 ]]; then
|
||||||
not_started+=("$process_name")
|
not_started+=($process_name)
|
||||||
else
|
else
|
||||||
# If there are PIDs, loop through each one
|
# If there are PIDs, loop through each one
|
||||||
for pid in "${pids[@]}"; do
|
for pid in "${pids[@]}"; do
|
||||||
local command=$(ps -p $pid -o cmd=)
|
local command=$(ps -p $pid -o cmd=)
|
||||||
local start_time=$(ps -p $pid -o lstart=)
|
local start_time=$(ps -p $pid -o lstart=)
|
||||||
local port=$(get_port $pid | tr -d '\n') # Remove any newline characters
|
local port=$(get_port $pid)
|
||||||
|
|
||||||
# Add space within port numbers, assuming you need to format them
|
|
||||||
if [[ ! -z $port && $port != "N/A" ]]; then
|
|
||||||
# Example formatting: assuming ports are returned as a single long string and you want to separate every 4 characters with a space
|
|
||||||
port=$(echo "$port" | sed 's/.\{4\}/& /g')
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
# Check if port information was found for the PID
|
||||||
if [[ -z $port ]]; then
|
if [[ -z $port ]]; then
|
||||||
port="N/A"
|
port="N/A"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user