diff options
author | Florian Eckert <fe@dev.tdt.de> | 2024-04-29 08:57:19 +0200 |
---|---|---|
committer | Florian Eckert <fe@dev.tdt.de> | 2024-04-29 08:57:30 +0200 |
commit | 8f2dfa7058e184a064a2f3d49291ad9e446b3228 (patch) | |
tree | 0dcf44a2789bf9ac04a1150f1c8d2b5ef4e381b7 /modules/luci-base/root | |
parent | 07342ef9ad6188597abef0428cd637cc787e5e29 (diff) |
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 <ptpt52@gmail.com>
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Diffstat (limited to 'modules/luci-base/root')
-rwxr-xr-x | modules/luci-base/root/etc/init.d/ucitrack | 17 |
1 files 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 } |