diff --git a/scripts/check-all-by-signal.sh b/scripts/check-all-by-signal.sh index d835b547c..ba8695cfa 100644 --- a/scripts/check-all-by-signal.sh +++ b/scripts/check-all-by-signal.sh @@ -43,10 +43,10 @@ trap handle_error ERR # Assuming openim::util::check_ports_by_signal function sets a proper exit status # based on whether services are running or not. if openim::util::check_ports_by_signal ${OPENIM_SERVER_PORT_LISTARIES[@]}; then - echo "++++ All openim service ports stop successfully !" -else echo "+++ cat openim log file >>> ${LOG_FILE}" - openim::log::error_exit "The service does not stop properly, there are still processes running, please check!" + openim::log::error_exit "The service does not stop properly, there are still processes running, please check!" +else + echo "++++ All openim service ports stop successfully !" fi set -e diff --git a/scripts/lib/util.sh b/scripts/lib/util.sh index 7f1c9e6ac..74d8d977c 100755 --- a/scripts/lib/util.sh +++ b/scripts/lib/util.sh @@ -440,13 +440,13 @@ openim::util::check_ports_by_signal() { # If any of the processes is not running, return a status of 1. if [[ ${#not_started[@]} -ne 0 ]]; then + openim::log::success "All specified processes are running." + return 1 + else openim::color::echo $COLOR_RED " OpenIM Stdout Log >> cat ${LOG_FILE}" openim::color::echo $COLOR_RED " OpenIM Stderr Log >> cat ${STDERR_LOG_FILE}" cat "$TMP_LOG_FILE" | awk '{print "\033[31m" $0 "\033[0m"}' - return 1 - else -# openim::log::success "All specified processes are running." - openim::log::success "Have processes no stop." + openim::log::error "Have processes no stop." return 0 fi }