From 60334e96ea012f2e6b9ee9b9231d375b1f0e39ff Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Thu, 26 Mar 2026 15:17:44 +0100 Subject: [PATCH] fix(luci-app-masterlink): Handle missing JSON fields in sbx-mesh-join Add || true to jsonfilter commands to prevent script exit when optional fields (master_fingerprint, depth) are missing from API response. The set -e directive was causing premature exit. Co-Authored-By: Claude Opus 4.5 --- .../luci-app-masterlink/root/usr/bin/sbx-mesh-join | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/secubox/luci-app-masterlink/root/usr/bin/sbx-mesh-join b/package/secubox/luci-app-masterlink/root/usr/bin/sbx-mesh-join index beab844b..e72e394f 100644 --- a/package/secubox/luci-app-masterlink/root/usr/bin/sbx-mesh-join +++ b/package/secubox/luci-app-masterlink/root/usr/bin/sbx-mesh-join @@ -165,10 +165,10 @@ main() { local depth="" if command -v jsonfilter >/dev/null; then - status=$(echo "$response" | jsonfilter -e '@.status' 2>/dev/null) - message=$(echo "$response" | jsonfilter -e '@.message' 2>/dev/null) - master_fp=$(echo "$response" | jsonfilter -e '@.master_fingerprint' 2>/dev/null) - depth=$(echo "$response" | jsonfilter -e '@.depth' 2>/dev/null) + status=$(echo "$response" | jsonfilter -e '@.status' 2>/dev/null || true) + message=$(echo "$response" | jsonfilter -e '@.message' 2>/dev/null || true) + master_fp=$(echo "$response" | jsonfilter -e '@.master_fingerprint' 2>/dev/null || true) + depth=$(echo "$response" | jsonfilter -e '@.depth' 2>/dev/null || true) elif command -v jq >/dev/null; then status=$(echo "$response" | jq -r '.status // empty') message=$(echo "$response" | jq -r '.message // empty')