reload_config 489 B

123456789101112131415
  1. #!/bin/sh
  2. rm -rf /var/run/config.check
  3. mkdir -p /var/run/config.check
  4. for config in /etc/config/*; do
  5. file=${config##*/}
  6. uci show "${file##*/}" > /var/run/config.check/$file
  7. done
  8. MD5FILE=/var/run/config.md5
  9. [ -f $MD5FILE ] && {
  10. for c in `md5sum -c $MD5FILE 2>/dev/null| grep FAILED | cut -d: -f1`; do
  11. ubus call service event "{ \"type\": \"config.change\", \"data\": { \"package\": \"$(basename $c)\" }}"
  12. done
  13. }
  14. md5sum /var/run/config.check/* > $MD5FILE
  15. rm -rf /var/run/config.check