Update check-all.sh (#1643)

pull/1646/head v3.5.1-rc.0
Xinwei Xiong 1 year ago committed by GitHub
parent a7138cb3b7
commit bed112d037
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -30,16 +30,18 @@ OPENIM_VERBOSE=4
openim::log::info "\n# Begin to check all openim service"
# Elegant printing function
# Elegant printing function
print_services_and_ports() {
local -n service_names=$1
local -n service_ports=$2
local service_names=("$@")
local half_length=$((${#service_names[@]} / 2))
local service_ports=("${service_names[@]:half_length}")
echo "+-------------------------+----------+"
echo "| Service Name | Port |"
echo "+-------------------------+----------+"
for index in "${!service_names[@]}"; do
for ((index=0; index < half_length; index++)); do
printf "| %-23s | %-8s |\n" "${service_names[$index]}" "${service_ports[$index]}"
done
@ -50,11 +52,10 @@ print_services_and_ports() {
# Similarly for OPENIM_DEPENDENCY_TARGETS and OPENIM_DEPENDENCY_PORT_TARGETS
# Print out services and their ports
print_services_and_ports OPENIM_SERVER_NAME_TARGETS OPENIM_SERVER_PORT_TARGETS
print_services_and_ports "${OPENIM_SERVER_NAME_TARGETS[@]}" "${OPENIM_SERVER_PORT_TARGETS[@]}"
# Print out dependencies and their ports
print_services_and_ports OPENIM_DEPENDENCY_TARGETS OPENIM_DEPENDENCY_PORT_TARGETS
print_services_and_ports "${OPENIM_DEPENDENCY_TARGETS[@]}" "${OPENIM_DEPENDENCY_PORT_TARGETS[@]}"
# OpenIM check
echo "++ The port being checked: ${OPENIM_SERVER_PORT_LISTARIES[@]}"
@ -91,4 +92,4 @@ else
echo "++++ Check all openim service ports successfully !"
fi
set -e
set -e

Loading…
Cancel
Save