diff options
Diffstat (limited to 'network/avahi/doinst.sh')
-rw-r--r-- | network/avahi/doinst.sh | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/network/avahi/doinst.sh b/network/avahi/doinst.sh index a6a2efd52c..d22f3fa394 100644 --- a/network/avahi/doinst.sh +++ b/network/avahi/doinst.sh @@ -11,24 +11,22 @@ config() { # Otherwise, we leave the .new copy for the admin to consider... } -# Keep same perms on rc.avahidaemon.new: -if [ -e etc/rc.d/rc.avahidaemon ]; then - cp -a etc/rc.d/rc.avahidaemon etc/rc.d/rc.avahidaemon.new.incoming - cat etc/rc.d/rc.avahidaemon.new > etc/rc.d/rc.avahidaemon.new.incoming - mv etc/rc.d/rc.avahidaemon.new.incoming etc/rc.d/rc.avahidaemon.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 +} -# Keep same perms on rc.avahidnsconfd.new: -if [ -e etc/rc.d/rc.avahidnsconfd ]; then - cp -a etc/rc.d/rc.avahidnsconfd etc/rc.d/rc.avahidnsconfd.new.incoming - cat etc/rc.d/rc.avahidnsconfd.new > etc/rc.d/rc.avahidnsconfd.new.incoming - mv etc/rc.d/rc.avahidnsconfd.new.incoming etc/rc.d/rc.avahidnsconfd.new -fi -config etc/rc.d/rc.avahidaemon.new -config etc/rc.d/rc.avahidnsconfd.new -config etc/avahi/avahi-daemon.conf.new -config etc/dbus-1/system.d/avahi-dbus.conf.new +preserve_perms etc/rc.d/rc.avahidaemon.new +preserve_perms etc/rc.d/rc.avahidnsconfd.new +preserve_perms etc/avahi/avahi-daemon.conf.new +preserve_perms etc/dbus-1/system.d/avahi-dbus.conf.new if [ -x /usr/bin/update-desktop-database ]; then /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 |