+++ /dev/null
-config network
- option init network
- list affects dhcp
-
-config wireless
- list affects network
-
-config firewall
- option init firewall
- list affects luci-splash
- list affects qos
- list affects miniupnpd
-
-config olsr
- option init olsrd
-
-config dhcp
- option init dnsmasq
- list affects odhcpd
-
-config odhcpd
- option init odhcpd
-
-config dropbear
- option init dropbear
-
-config httpd
- option init httpd
-
-config fstab
- option exec '/sbin/block mount'
-
-config qos
- option init qos
-
-config system
- option init led
- option exec '/etc/init.d/log reload'
- list affects luci_statistics
- list affects dhcp
-
-config luci_splash
- option init luci_splash
-
-config upnpd
- option init miniupnpd
-
-config ntpclient
- option init ntpclient
-
-config samba
- option init samba
-
-config tinyproxy
- option init tinyproxy
-
START=80
USE_PROCD=1
+. "$IPKG_INSTROOT/usr/share/libubox/jshn.sh"
+
register_init() {
local config="$1"
local init="$2"
}
register_trigger() {
- local sid="$1"
+ local uci="$1"
+ local file="$2"
+
local config init exec affects affected
+ local prev
- config_get config "$sid" TYPE
- config_get init "$sid" init
- config_get exec "$sid" exec
- config_get affects "$sid" affects
+ json_set_namespace config prev
+ 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'
+ json_cleanup
+ json_set_namespace "$prev"
if [ -n "$init" ]; then
register_init "$config" "/etc/init.d/$init" "reload"
done
}
-service_triggers() {
- config_foreach register_trigger
+check_trigger() {
+ local config="$1"
+
+ local file
+
+ for file in /usr/share/ucitrack/*.json; do
+ [ -f "$file" ] || continue
+ register_trigger "$config" "$file"
+ done
}
-start_service() {
- config_load ucitrack
+service_triggers() {
+ for config in /etc/config/*; do
+ check_trigger "${config##*/}"
+ done
}