From 515021018cf4aa57421148950af6de26ad853465 Mon Sep 17 00:00:00 2001 From: cfdaily Date: Tue, 2 Jun 2026 22:05:28 +0800 Subject: [PATCH] auto-sync: 2026-06-02 22:05:28 --- scripts/gateway-watchdog.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/gateway-watchdog.sh b/scripts/gateway-watchdog.sh index 65b7379..0e61bf4 100755 --- a/scripts/gateway-watchdog.sh +++ b/scripts/gateway-watchdog.sh @@ -146,7 +146,7 @@ _safe_count() { count=$(grep -c "$1" 2>/dev/null || true) # 去掉所有空白和换行,确保是纯数字 count=$(echo "$count" | tr -d '[:space:]') - [ -z "$count" ] && count=0 + if [ -z "$count" ]; then count=0; fi echo "$count" }