luci-base: ucitrack: fix broken affects logic
authorJo-Philipp Wich <jo@mein.io>
Wed, 30 Mar 2022 12:09:10 +0000 (14:09 +0200)
committerJo-Philipp Wich <jo@mein.io>
Wed, 30 Mar 2022 12:12:38 +0000 (14:12 +0200)
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>
modules/luci-base/root/etc/init.d/ucitrack

index c7ceb32905babed000110f7673633486885a8d85..57ac11857f5aa6be71a5f90da4cfe80cebf024ca 100755 (executable)
@@ -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
 }