fix: convert dashes to underscores in module ID detection

The RPCD backend was generating module IDs with dashes (network-modes,
client-guardian, etc.) but the UCI config uses underscores (network_modes,
client_guardian, etc.). This mismatch prevented modules from being loaded
and displayed in the dashboard.

Fixed by adding conversion of dashes to underscores when generating
module IDs from RPCD script names.

Fixes: luci-app-secubox/root/usr/libexec/rpcd/secubox:18
This commit is contained in:
CyberMind-FR 2025-12-24 00:15:12 +01:00
parent 3cd072382a
commit 4401c66da9

View File

@ -14,8 +14,8 @@ detect_modules() {
for script in $scripts; do
if [ -x "/usr/libexec/rpcd/$script" ]; then
# Convert script name to module ID (remove -dashboard suffix)
local module_id=$(echo "$script" | sed 's/-dashboard$//')
# Convert script name to module ID (remove -dashboard suffix, convert dashes to underscores)
local module_id=$(echo "$script" | sed 's/-dashboard$//' | sed 's/-/_/g')
modules="$modules $module_id"
fi
done