doinst.sh 923 B

12345678910111213141516171819202122232425262728293031323334
  1. config() {
  2. NEW="$1"
  3. OLD="$(dirname $NEW)/$(basename $NEW .new)"
  4. # If there's no config file by that name, mv it over:
  5. if [ ! -r $OLD ]; then
  6. mv $NEW $OLD
  7. elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
  8. # toss the redundant copy
  9. rm $NEW
  10. fi
  11. # Otherwise, we leave the .new copy for the admin to consider...
  12. }
  13. preserve_perms() {
  14. NEW="$1"
  15. OLD="$(dirname $NEW)/$(basename $NEW .new)"
  16. if [ -e $OLD ]; then
  17. cp -a $OLD ${NEW}.incoming
  18. cat $NEW > ${NEW}.incoming
  19. mv ${NEW}.incoming $NEW
  20. fi
  21. config $NEW
  22. }
  23. preserve_perms etc/rc.d/rc.spamd.new
  24. config etc/mail/spamassassin/init.pre.new
  25. config etc/mail/spamassassin/local.cf.new
  26. config etc/mail/spamassassin/v310.pre.new
  27. config etc/mail/spamassassin/v312.pre.new
  28. config etc/mail/spamassassin/v320.pre.new
  29. config etc/mail/spamassassin/v330.pre.new
  30. config etc/mail/spamassassin/v340.pre.new
  31. config etc/spamassassin.conf.new