aboutsummaryrefslogtreecommitdiffstats
path: root/package/system/procd/files/reload_config
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2013-07-11 17:00:54 +0000
committerJohn Crispin <john@openwrt.org>2013-07-11 17:00:54 +0000
commit8eb56a88a49755cf8b58b65e9fc53df11043cab1 (patch)
tree7a14f09343a3c534de2dcce53e69d889008e8bd9 /package/system/procd/files/reload_config
parent67eb275f69a5861cb017d541bc83b32e587b3859 (diff)
downloadupstream-8eb56a88a49755cf8b58b65e9fc53df11043cab1.tar.gz
upstream-8eb56a88a49755cf8b58b65e9fc53df11043cab1.tar.bz2
upstream-8eb56a88a49755cf8b58b65e9fc53df11043cab1.zip
procd: add a small script that handles config reloads until configd is ready
Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 37248
Diffstat (limited to 'package/system/procd/files/reload_config')
-rw-r--r--package/system/procd/files/reload_config8
1 files changed, 8 insertions, 0 deletions
diff --git a/package/system/procd/files/reload_config b/package/system/procd/files/reload_config
new file mode 100644
index 0000000000..ef8ab87e0c
--- /dev/null
+++ b/package/system/procd/files/reload_config
@@ -0,0 +1,8 @@
+#!/bin/sh
+MD5FILE=/var/run/config.md5
+[ -f $MD5FILE ] && {
+ for c in `md5sum -c $MD5FILE 2>/dev/null| grep FAILED | cut -d: -f1`; do
+ ubus call service event "{ \"type\": \"config.change\", \"data\": { \"package\": \"$(basename $c)\" }}"
+ done
+}
+md5sum /etc/config/* > $MD5FILE