luci-base: ucitrack: fix broken affects logic

Changes on a given configuration should trigger change events on affected
configurations, not the other way around.

Fixes: #5745
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2022-03-30 14:09:10 +02:00
parent db2ae35988
commit 7110635134

View file

@ -41,10 +41,10 @@ register_trigger() {
fi
for affected in $affects; do
logger -t "ucitrack" "Setting up /etc/config/$config reload dependency on /etc/config/$affected"
procd_add_config_trigger "config.change" "$affected" \
logger -t "ucitrack" "Setting up /etc/config/$affected reload dependency on /etc/config/$config"
procd_add_config_trigger "config.change" "$config" \
ubus call service event \
"$(printf '{"type":"config.change","data":{"package":"%s"}}' $config)"
"$(printf '{"type":"config.change","data":{"package":"%s"}}' $affected)"
done
}