From 1bc26661a1b60ae43a165da8760b23230d6e4f61 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 29 Jul 2014 02:12:24 +0000 Subject: procd: check output of "uci show" instead of raw config files in order to track uncommitted changes Signed-off-by: Felix Fietkau git-svn-id: svn://svn.openwrt.org/openwrt/trunk@41865 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/system/procd/files/reload_config | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'package/system/procd') diff --git a/package/system/procd/files/reload_config b/package/system/procd/files/reload_config index ef8ab87e0c..8d1cdb1378 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 -- cgit v1.2.3