luci-add-conffiles.sh 554 B

123456789101112131415161718192021222324252627
  1. add_luci_conffiles()
  2. {
  3. add_luci_conffiles_helper()
  4. {
  5. [ ! -f "$1" ] && return
  6. grep -q "$1" "$2" && return
  7. echo "$1" >> "$2"
  8. }
  9. local filelist="$1"
  10. # save ssl certs
  11. if [ -d /etc/nixio ]; then
  12. find /etc/nixio -type f | while read ff; do
  13. add_luci_conffiles_helper "$ff" "$filelist"
  14. done
  15. fi
  16. # save uhttpd certs
  17. add_luci_conffiles_helper /etc/uhttpd.key "$filelist"
  18. add_luci_conffiles_helper /etc/uhttpd.crt "$filelist"
  19. unset -f add_luci_conffiles_helper
  20. }
  21. sysupgrade_init_conffiles="$sysupgrade_init_conffiles add_luci_conffiles"