aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doinst.sh18
1 files changed, 11 insertions, 7 deletions
diff --git a/doinst.sh b/doinst.sh
index b5f65c0..1683756 100644
--- a/doinst.sh
+++ b/doinst.sh
@@ -11,14 +11,18 @@ config() {
# Otherwise, we leave the .new copy for the admin to consider...
}
-# Keep same perms on rc.INIT.new:
-if [ -e etc/rc.d/rc.INIT ]; then
- cp -a etc/rc.d/rc.INIT etc/rc.d/rc.INIT.new.incoming
- cat etc/rc.d/rc.INIT.new > etc/rc.d/rc.INIT.new.incoming
- mv etc/rc.d/rc.INIT.new.incoming etc/rc.d/rc.INIT.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.INIT.new
+preserve_perms etc/rc.d/rc.INIT.new
config etc/configfile.new
if [ -x /usr/bin/update-desktop-database ]; then