diff options
Diffstat (limited to 'network/dovecot/doinst.sh')
-rw-r--r-- | network/dovecot/doinst.sh | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/network/dovecot/doinst.sh b/network/dovecot/doinst.sh index 088bd4ecc8..f39fc6ebd4 100644 --- a/network/dovecot/doinst.sh +++ b/network/dovecot/doinst.sh @@ -10,13 +10,15 @@ config() { fi # Otherwise, we leave the .new copy for the admin to consider... } - -# Keep same perms on rc.dovecot.new: -if [ -e etc/rc.d/rc.dovecot ]; then - cp -a etc/rc.d/rc.dovecot etc/rc.d/rc.dovecot.new.incoming - cat etc/rc.d/rc.dovecot.new > etc/rc.d/rc.dovecot.new.incoming - mv etc/rc.d/rc.dovecot.new.incoming etc/rc.d/rc.dovecot.new -fi - -config etc/rc.d/rc.dovecot.new +preserve_perms() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ -e $OLD ]; then + cp -a $OLD ${NEW}.incoming + cat $NEW > ${NEW}.incoming + mv ${NEW}.incoming $NEW + fi + config $NEW +} +preserve_perms etc/rc.d/rc.dovecot.new |