mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2026-03-06 10:30:36 +01:00
Check /var/run/uci/ before /etc/config/ so that overlay configs
also trigger service reload events.
The overlay directory takes precedence, and uci show already handles
merging overlay + base configuration correctly.
Signed-off-by: John Crispin <john@phrozen.org>
(cherry picked from commit aaa2d9f1e5)
17 lines
591 B
Bash
17 lines
591 B
Bash
#!/bin/sh
|
|
rm -rf /var/run/config.check
|
|
mkdir -p /var/run/config.check
|
|
for config in /var/run/uci/* /etc/config/*; do
|
|
[ -f "$config" ] || continue
|
|
file=${config##*/}
|
|
[ -f "/var/run/config.check/$file" ] && continue
|
|
uci show "$file" > /var/run/config.check/$file 2>/dev/null
|
|
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 /var/run/config.check/* > $MD5FILE
|
|
rm -rf /var/run/config.check
|