procd: add a shell helper function to emit a config.change event
authorFelix Fietkau <nbd@openwrt.org>
Wed, 2 Jul 2014 19:18:20 +0000 (19:18 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 2 Jul 2014 19:18:20 +0000 (19:18 +0000)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 41482

package/system/procd/files/procd.sh

index 3465c639aa9b6142dc787f8272b9159c24b21589..1b19ba93f673963410c99e80d49f0c8c494cfcea 100644 (file)
@@ -275,6 +275,18 @@ procd_close_data() {
        json_set_namespace $__procd_old_cb
 }
 
+_procd_set_config_changed() {
+       local package="$1"
+
+       json_init
+       json_add_string type config.change
+       json_add_object data
+       json_add_string package "$package"
+       json_close_object
+
+       ubus call service event "$(json_dump)"
+}
+
 uci_validate_section()
 {
        local _package="$1"
@@ -308,4 +320,5 @@ _procd_wrapper \
        procd_set_param \
        procd_append_param \
        procd_add_validation \
+       procd_set_config_changed \
        procd_kill