aboutsummaryrefslogtreecommitdiffstats
path: root/package/system/procd/files
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
commit218ae8eb0021e869160133ef3f0f8e82ffae62db (patch)
tree7cd4dbf15bdfc23beee9a3898f8871158ef14ba0 /package/system/procd/files
parent42647b77cc3abe1c3fa10017a5e11e60de7277a0 (diff)
downloadupstream-218ae8eb0021e869160133ef3f0f8e82ffae62db.tar.gz
upstream-218ae8eb0021e869160133ef3f0f8e82ffae62db.tar.bz2
upstream-218ae8eb0021e869160133ef3f0f8e82ffae62db.zip
procd: add a shell helper function to emit a config.change event
Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@41482 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/system/procd/files')
-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 3465c639aa..1b19ba93f6 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