From 1ab19cb778ef962b77ebdde215104f3de6c617e0 Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Wed, 11 Feb 2026 11:51:53 +0100 Subject: [PATCH] fix(interceptor): Fix RPCD handler shell syntax error Remove 'local' keyword from case statement block where it's not allowed in POSIX shell. Replace && block conditions with proper if/then/fi statements for health score calculation. Co-Authored-By: Claude Opus 4.5 --- .../root/usr/libexec/rpcd/luci.interceptor | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/package/secubox/luci-app-interceptor/root/usr/libexec/rpcd/luci.interceptor b/package/secubox/luci-app-interceptor/root/usr/libexec/rpcd/luci.interceptor index ae5b857c..2635ebe3 100644 --- a/package/secubox/luci-app-interceptor/root/usr/libexec/rpcd/luci.interceptor +++ b/package/secubox/luci-app-interceptor/root/usr/libexec/rpcd/luci.interceptor @@ -177,38 +177,38 @@ case "$1" in get_failover_status # Overall health score (0-100) - local score=0 - local pillars_active=0 + score=0 + pillars_active=0 # WPAD - [ "$(uci -q get network_tweaks.global.wpad_enforce)" = "1" ] || [ -f /www/wpad.dat ] && { + if [ "$(uci -q get network_tweaks.global.wpad_enforce)" = "1" ] || [ -f /www/wpad.dat ]; then score=$((score + 20)) pillars_active=$((pillars_active + 1)) - } + fi # mitmproxy running - pgrep -x mitmproxy >/dev/null 2>&1 || lxc-ls --running 2>/dev/null | grep -q "secbx-mitmproxy" && { + if pgrep mitmproxy >/dev/null 2>&1 || lxc-ls --running 2>/dev/null | grep -q "secbx-mitmproxy"; then score=$((score + 20)) pillars_active=$((pillars_active + 1)) - } + fi # CDN Cache running - pgrep squid >/dev/null 2>&1 && { + if pgrep squid >/dev/null 2>&1; then score=$((score + 20)) pillars_active=$((pillars_active + 1)) - } + fi # Cookie Tracker enabled - [ "$(uci -q get cookie-tracker.main.enabled)" = "1" ] && { + if [ "$(uci -q get cookie-tracker.main.enabled)" = "1" ]; then score=$((score + 20)) pillars_active=$((pillars_active + 1)) - } + fi # API Failover enabled - [ "$(uci -q get cdn-cache.api_failover.enabled)" = "1" ] && { + if [ "$(uci -q get cdn-cache.api_failover.enabled)" = "1" ]; then score=$((score + 20)) pillars_active=$((pillars_active + 1)) - } + fi json_add_object "summary" json_add_int "health_score" "$score"