Optimize script logs

pull/2007/head
skiffer-git 2 years ago
parent 071937de50
commit 2b4063a9f7

@ -415,11 +415,12 @@ openim::util::check_process_names() {
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 newline characters
local port=$(get_port $pid | tr -d '\n') # Remove any newline characters
# Insert a space at the desired position in the port string
# Add space within port numbers, assuming you need to format them
if [[ ! -z $port && $port != "N/A" ]]; then
port="${port:0:4} ${port:4}" # Add a space after the fourth character
# 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
if [[ -z $port ]]; then
@ -433,6 +434,7 @@ openim::util::check_process_names() {
# Print information
if [[ ${#not_started[@]} -ne 0 ]]; then
echo "Not started processes:"

Loading…
Cancel
Save