Luci change monitor

I am writing a daemon for LEDE/OpenWRT, and I would like to reload configuration whenever there is a change by the user. So I'd like to detect if someone press "apply" on the GUI. I bet that this is done using ubus. My daemon is written in lua. Could you provide how to catch such events?

Thank you,
Levente

Please provide more details about what you want to do. A specific app? Any config in the system?

There is already existing functionality in procd (and old ucitrack system) for reloading/restarting necessary apps when config changes.

I'm writing an application that checks network connectivity, and when the network is up/down for whatever reason, it changes GPIO lines etc... I store configurations in the UCI system like which GPIO lines to use. I want this to be "real time", i.e. if someone changes something, my daemon shall react asap. I don't want to poll the configurations as it'd take too long... there are also an LTE modem there I shall manage.

Everything works as expected, I only miss the configuration monitoring function.

Thanks,
Lev

Check network connectivity using hotplug event:

cat<<'EOF' > /etc/hotplug.d/iface/99-wan-up-down
#!/bin/sh
[ "$ACTION" = "ifup" -a "$INTERFACE" = "wan" ] && {
    logger "wan up"
    sleep 10
    sh -x /etc/wan_up.sh
}
[ "$ACTION" = "ifdown" -a "$INTERFACE" = "wan" ] && {
    logger "wan down"
    sleep 11
    sh -x /etc/wan_down.sh
}
exit 0
EOF

chmod +x /etc/hotplug.d/iface/99-wan-up-down