From 38c1fe40fe08ba186e846efe2bb5829b9638b9b1 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 2 Apr 2024 17:12:25 +0800 Subject: [PATCH] Script Refactoring --- scripts-new/lib/util.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts-new/lib/util.sh b/scripts-new/lib/util.sh index 9d2170a70..48ca21875 100644 --- a/scripts-new/lib/util.sh +++ b/scripts-new/lib/util.sh @@ -2476,7 +2476,7 @@ function openim::util::print_binary_ports() { # Remove trailing spaces and duplicate ports if any ports=$(echo "$ports" | xargs | tr ' ' '\n' | uniq | tr '\n' ' ') - if [[ ! -n "$ports" ]]; then + if [[ ${#ports} -eq 1 ]]; then echo "$binary_path is not listening on any ports." ["$ports"] else echo "$binary_path is listening on the following ports: $ports" ["$ports"]