From df328287121f627762c4f3a90f781302a6f6300f Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Thu, 21 Mar 2024 18:45:23 +0800 Subject: [PATCH] Optimizing scripts --- scripts/check-all.sh | 2 +- scripts/lib/util.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/check-all.sh b/scripts/check-all.sh index 0c3d1edbe..2fc773b2f 100755 --- a/scripts/check-all.sh +++ b/scripts/check-all.sh @@ -101,7 +101,6 @@ for item in "${OPENIM_ALL_SERVICE_LIBRARIES_NO_TRANSFER[@]}"; do openim::log::colorless "$item" done -openim::log::status "List the ports listened to by the OpenIM service:" result=$(openim::util::check_process_names ${OPENIM_ALL_SERVICE_LIBRARIES_NO_TRANSFER[@]}) if [[ $? -ne 0 ]]; then @@ -110,6 +109,7 @@ if [[ $? -ne 0 ]]; then echo "$result" exit 1 else + openim::log::status "List the ports listened to by the OpenIM service:" openim::util::find_ports_for_all_services ${OPENIM_ALL_SERVICE_LIBRARIES_NO_TRANSFER[@]} openim::util::find_ports_for_all_services ${OPENIM_MSGTRANSFER_BINARY[@]} openim::log::success "All OpenIM services are running normally! " diff --git a/scripts/lib/util.sh b/scripts/lib/util.sh index 5a5de4003..6bb330981 100755 --- a/scripts/lib/util.sh +++ b/scripts/lib/util.sh @@ -603,6 +603,7 @@ openim::util::stop_services_with_name() { # Iterate over each given service name. for server_name in "$@"; do # Use the `pgrep` command to find process IDs related to the given service name. + echo "Stopping services with names: $server_name" local pids=$(pgrep -f "$server_name") # If no process was found with the name, add it to the not_stopped list