From 8f2dfa7058e184a064a2f3d49291ad9e446b3228 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Mon, 29 Apr 2024 08:57:19 +0200 Subject: [PATCH] luci-base: always add ucitrack independently of uci config It is possible that the uci configuration file will be added to the system later. Therefore, ucitrack json definitions are always added to ucitrack triggers and it is not checked whether the uci configuration file exists. Reported-by: Chen Minqiang Signed-off-by: Florian Eckert --- modules/luci-base/root/etc/init.d/ucitrack | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/modules/luci-base/root/etc/init.d/ucitrack b/modules/luci-base/root/etc/init.d/ucitrack index 495949f64f..651a9b4575 100755 --- a/modules/luci-base/root/etc/init.d/ucitrack +++ b/modules/luci-base/root/etc/init.d/ucitrack @@ -17,8 +17,7 @@ register_init() { } register_trigger() { - local uci="$1" - local file="$2" + local file="$1" local config init exec affects affected local prev @@ -27,10 +26,6 @@ register_trigger() { json_init json_load_file "${file}" >/dev/null 2>&1 json_get_var config 'config' - [ "$config" = "$uci" ] || { - json_set_namespace "$prev" - return - } json_get_var init 'init' json_get_var exec 'exec' json_get_values affects 'affects' @@ -62,19 +57,13 @@ register_trigger() { done } -check_trigger() { +service_triggers() { local config="$1" local file for file in /usr/share/ucitrack/*.json; do [ -f "$file" ] || continue - register_trigger "$config" "$file" - done -} - -service_triggers() { - for config in /etc/config/*; do - check_trigger "${config##*/}" + register_trigger "$file" done } -- 2.30.2