1 #!/bin/sh /etc/rc.common
6 .
"$IPKG_INSTROOT/usr/share/libubox/jshn.sh"
13 if [ -x "$init" ] && "$init" enabled
&& ! grep -sqE 'USE_PROCD=.' "$init"; then
14 logger
-t "ucitrack" "Setting up /etc/config/$config reload trigger for non-procd $init"
15 procd_add_config_trigger
"config.change" "$config" "$init" "$@"
22 local config init
exec affects affected
25 json_set_namespace config prev
27 json_load_file
"${file}" >/dev
/null
2>&1
28 json_get_var config
'config'
29 json_get_var init
'init'
30 json_get_var
exec 'exec'
31 json_get_values affects
'affects'
33 json_set_namespace
"$prev"
35 if [ -n "$init" ]; then
36 register_init
"$config" "/etc/init.d/$init" "reload"
39 if [ -n "$exec" ]; then
43 register_init
"$config" "$@"
46 logger
-t "ucitrack" "Setting up non-init /etc/config/$config reload handler: $exec"
47 procd_add_config_trigger
"config.change" "$config" $exec
52 for affected
in $affects; do
53 logger
-t "ucitrack" "Setting up /etc/config/$affected reload dependency on /etc/config/$config"
54 procd_add_config_trigger
"config.change" "$config" \
55 ubus call service event \
56 "$(printf '{"type":"config.change
","data
":{"package
":"%s
"}}' $affected)"
65 for file in /usr
/share
/ucitrack
/*.json
; do
66 [ -f "$file" ] ||
continue
67 register_trigger
"$file"