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
lede-17.01
Felix Fietkau 2014-07-29 02:12:24 +00:00
parent c6d1992701
commit caeb675a46
1 changed files with 8 additions and 1 deletions

View File

@ -1,8 +1,15 @@
#!/bin/sh #!/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 MD5FILE=/var/run/config.md5
[ -f $MD5FILE ] && { [ -f $MD5FILE ] && {
for c in `md5sum -c $MD5FILE 2>/dev/null| grep FAILED | cut -d: -f1`; do 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)\" }}" ubus call service event "{ \"type\": \"config.change\", \"data\": { \"package\": \"$(basename $c)\" }}"
done done
} }
md5sum /etc/config/* > $MD5FILE md5sum /var/run/config.check/* > $MD5FILE
rm -rf /var/run/config.check