Optimize script logs

pull/2007/head
skiffer-git 2 years ago
parent ae12ec532b
commit ea6806f1c6

@ -409,20 +409,15 @@ openim::util::check_process_names() {
# Check if any process IDs were found
if [[ ${#pids[@]} -eq 0 ]]; then
not_started+=("$process_name")
not_started+=($process_name)
else
# If there are PIDs, loop through each one
for pid in "${pids[@]}"; do
local command=$(ps -p $pid -o cmd=)
local start_time=$(ps -p $pid -o lstart=)
local port=$(get_port $pid | tr -d '\n') # Remove any newline characters
# 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
local port=$(get_port $pid)
# Check if port information was found for the PID
if [[ -z $port ]]; then
port="N/A"
fi

Loading…
Cancel
Save