From fd237285e45dfd669d2b87a15eeefb7fa6535513 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 2 Apr 2024 16:57:18 +0800 Subject: [PATCH] Script Refactoring --- scripts-new/check.sh | 3 ++- scripts-new/lib/logging.sh | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts-new/check.sh b/scripts-new/check.sh index f28efc405..fdaa26de8 100644 --- a/scripts-new/check.sh +++ b/scripts-new/check.sh @@ -40,6 +40,7 @@ else fi -print_listened_ports_by_binaries +result=$(print_listened_ports_by_binaries) +print_green_two_line "$result" diff --git a/scripts-new/lib/logging.sh b/scripts-new/lib/logging.sh index 19c78c768..51e2e20b1 100644 --- a/scripts-new/lib/logging.sh +++ b/scripts-new/lib/logging.sh @@ -267,6 +267,11 @@ function openim::log::print_blue() { } +function openim::log::print_green_two_line() { + local current_time=$(date "+%Y-%m-%d %H:%M:%S %Z") + echo -e "[$current_time]" + echo -e "\033[0;32m$1\033[0m" +} function openim::log::print_red() {