summaryrefslogtreecommitdiff
path: root/package/system/procd
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-07-02 19:18:20 +0000
committerFelix Fietkau <nbd@openwrt.org>2014-07-02 19:18:20 +0000
commit5aef137f9eb3a3236bdb7f50af887ff63368da2f (patch)
tree1c644eaa7bc8d09613024c7cc8e28e4952eebcad /package/system/procd
parent2baf4d4fb0d2232faa9fd57a665ba4f0bafe9523 (diff)
downloadmtk-20170518-5aef137f9eb3a3236bdb7f50af887ff63368da2f.zip
mtk-20170518-5aef137f9eb3a3236bdb7f50af887ff63368da2f.tar.gz
mtk-20170518-5aef137f9eb3a3236bdb7f50af887ff63368da2f.tar.bz2
procd: add a shell helper function to emit a config.change event
Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 41482
Diffstat (limited to 'package/system/procd')
-rw-r--r--package/system/procd/files/procd.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh
index 3465c63..1b19ba9 100644
--- a/package/system/procd/files/procd.sh
+++ b/package/system/procd/files/procd.sh
@@ -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