From 7e3f09ae7f98dff013764a0c8361a83ad59a8840 Mon Sep 17 00:00:00 2001 From: Tw93 Date: Thu, 11 Dec 2025 12:55:27 +0800 Subject: [PATCH] fix: remove trailing space in json_escape to prevent unknown action errors --- lib/check/health_json.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/check/health_json.sh b/lib/check/health_json.sh index cd69035..3423d60 100644 --- a/lib/check/health_json.sh +++ b/lib/check/health_json.sh @@ -87,7 +87,9 @@ get_uptime_days() { # JSON escape helper json_escape() { # Escape backslash, double quote, tab, and newline - echo -n "$1" | sed 's/\\/\\\\/g; s/"/\\"/g; s/ /\\t/g' | tr '\n' ' ' + local escaped + escaped=$(echo -n "$1" | sed 's/\\/\\\\/g; s/"/\\"/g; s/ /\\t/g' | tr '\n' ' ') + echo -n "${escaped% }" } # Generate JSON output