Signed-off-by: John Crispin <blogic@openwrt.org>
SVN-Revision: 37157
json_add_object "$name"
}
+_procd_open_trigger() {
+ json_add_array "triggers"
+}
+
_procd_set_param() {
local type="$1"; shift
esac
}
+_procd_add_config_trigger() {
+ json_add_array
+ _procd_add_array_data "config.change"
+
+ json_add_array
+ _procd_add_array_data "if"
+
+ json_add_array
+ _procd_add_array_data "eq" "package" "$1"
+ shift
+ json_close_array
+
+ json_add_array
+ _procd_add_array_data "run_script" "$@"
+ json_close_array
+
+ json_close_array
+
+ json_close_array
+}
+
_procd_append_param() {
local type="$1"; shift
json_close_object
}
+_procd_close_trigger() {
+ json_close_array
+}
+
_procd_add_instance() {
_procd_open_instance
_procd_set_command "$@"
procd_open_service \
procd_close_service \
procd_add_instance \
+ procd_add_config_trigger \
+ procd_open_trigger \
+ procd_close_trigger \
procd_open_instance \
procd_close_instance \
procd_set_param \