From 5903547fe80ec0c3b715c657f819ca1f568cbe3b Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Wed, 7 Jan 2026 12:30:41 +0100 Subject: [PATCH] fix: Fix secubox-profile script syntax and directory path (v0.6.0-r14) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Changed bash brace expansion `*.{yaml,yml,json}` to POSIX-compliant loops - Removed `2>/dev/null` from for loop glob (not supported in busybox sh) - Changed PROFILE_DIR from /etc/secubox/profiles to /usr/share/secubox/profiles - Fixes "syntax error: unexpected redirection" error - Fixes listProfiles RPC returning "No response" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- .../root/usr/sbin/secubox-profile | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/package/secubox/secubox-core/root/usr/sbin/secubox-profile b/package/secubox/secubox-core/root/usr/sbin/secubox-profile index d6793b1c..62da5d13 100755 --- a/package/secubox/secubox-core/root/usr/sbin/secubox-profile +++ b/package/secubox/secubox-core/root/usr/sbin/secubox-profile @@ -8,7 +8,7 @@ . /usr/share/libubox/jshn.sh . /lib/functions.sh -PROFILE_DIR="/etc/secubox/profiles" +PROFILE_DIR="/usr/share/secubox/profiles" TEMPLATE_DIR="/etc/secubox/templates" MACRO_DIR="/etc/secubox/macros" STATE_DIR="/var/run/secubox" @@ -21,10 +21,12 @@ list_profiles() { json_init json_add_array "profiles" - for profile in "$PROFILE_DIR"/*.{yaml,yml,json} 2>/dev/null; do - [ -f "$profile" ] || continue - local name=$(basename "$profile" | sed 's/\.\(yaml\|yml\|json\)$//') - json_add_string "" "$name" + for ext in yaml yml json; do + for profile in "$PROFILE_DIR"/*.$ext; do + [ -f "$profile" ] || continue + local name=$(basename "$profile" | sed 's/\.\(yaml\|yml\|json\)$//') + json_add_string "" "$name" + done done json_close_array @@ -36,10 +38,12 @@ list_profiles() { if [ -z "$(ls -A "$PROFILE_DIR" 2>/dev/null)" ]; then echo " (none)" else - for profile in "$PROFILE_DIR"/*.{yaml,yml,json} 2>/dev/null; do - [ -f "$profile" ] || continue - local name=$(basename "$profile" | sed 's/\.\(yaml\|yml\|json\)$//') - echo " - $name" + for ext in yaml yml json; do + for profile in "$PROFILE_DIR"/*.$ext; do + [ -f "$profile" ] || continue + local name=$(basename "$profile" | sed 's/\.\(yaml\|yml\|json\)$//') + echo " - $name" + done done fi