summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-07-29 02:12:24 +0000
committerFelix Fietkau <nbd@openwrt.org>2014-07-29 02:12:24 +0000
commitcaeb675a46a363879a3b64b73bcd492c0d6af68c (patch)
tree92c86b6822cd1e8874f4da6b73100edb204992d4 /package
parentc6d19927013c52d73d6fa5212da0af7c37361266 (diff)
downloadmtk-20170518-caeb675a46a363879a3b64b73bcd492c0d6af68c.zip
mtk-20170518-caeb675a46a363879a3b64b73bcd492c0d6af68c.tar.gz
mtk-20170518-caeb675a46a363879a3b64b73bcd492c0d6af68c.tar.bz2
procd: check output of "uci show" instead of raw config files in order to track uncommitted changes
Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 41865
Diffstat (limited to 'package')
-rw-r--r--package/system/procd/files/reload_config9
1 files changed, 8 insertions, 1 deletions
diff --git a/package/system/procd/files/reload_config b/package/system/procd/files/reload_config
index ef8ab87..8d1cdb1 100644
--- a/package/system/procd/files/reload_config
+++ b/package/system/procd/files/reload_config
@@ -1,8 +1,15 @@
#!/bin/sh
+rm -rf /var/run/config.check
+mkdir -p /var/run/config.check
+for config in /etc/config/*; do
+ file=${config##*/}
+ uci show "${file##*/}" > /var/run/config.check/$file
+done
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
+md5sum /var/run/config.check/* > $MD5FILE
+rm -rf /var/run/config.check