summaryrefslogtreecommitdiff
path: root/libraries/libvirt/doinst.sh
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/libvirt/doinst.sh')
-rw-r--r--libraries/libvirt/doinst.sh15
1 files changed, 13 insertions, 2 deletions
diff --git a/libraries/libvirt/doinst.sh b/libraries/libvirt/doinst.sh
index 9ca1b21e7e..e1b32b324d 100644
--- a/libraries/libvirt/doinst.sh
+++ b/libraries/libvirt/doinst.sh
@@ -1,4 +1,3 @@
-#!/bin/sh
config() {
NEW="$1"
OLD="$(dirname $NEW)/$(basename $NEW .new)"
@@ -12,4 +11,16 @@ config() {
# Otherwise, we leave the .new copy for the admin to consider...
}
-config etc/rc.d/rc.libvirt.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.libvirt.new
+