diff options
Diffstat (limited to 'network/amavisd-new/doinst.sh')
-rw-r--r-- | network/amavisd-new/doinst.sh | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/network/amavisd-new/doinst.sh b/network/amavisd-new/doinst.sh index 637ab6bc82..ad648167ec 100644 --- a/network/amavisd-new/doinst.sh +++ b/network/amavisd-new/doinst.sh @@ -11,13 +11,17 @@ config() { # Otherwise, we leave the .new copy for the admin to consider... } -# Keep same perms on rc.amavisd.new: -if [ -e etc/rc.d/rc.amavisd-new ]; then - cp -a etc/rc.d/rc.amavisd-new etc/rc.d/rc.amavisd-new.new.incoming - cat etc/rc.d/rc.amavisd-new.new > etc/rc.d/rc.amavisd-new.new.incoming - mv etc/rc.d/rc.amavisd-new.new.incoming etc/rc.d/rc.amavisd-new.new -fi +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 +} -config etc/rc.d/rc.amavisd-new.new -config etc/amavisd.conf.new -config etc/logrotate.d/amavisd-new.new +preserve_perms etc/rc.d/rc.amavisd-new.new +preserve_perms etc/amavisd.conf.new +preserve_perms etc/logrotate.d/amavisd-new.new |