summaryrefslogtreecommitdiff
path: root/system/openct/doinst.sh
diff options
context:
space:
mode:
Diffstat (limited to 'system/openct/doinst.sh')
-rw-r--r--system/openct/doinst.sh19
1 files changed, 12 insertions, 7 deletions
diff --git a/system/openct/doinst.sh b/system/openct/doinst.sh
index bb02ff148c..76c6b78a52 100644
--- a/system/openct/doinst.sh
+++ b/system/openct/doinst.sh
@@ -11,14 +11,19 @@ config() {
# Otherwise, we leave the .new copy for the admin to consider...
}
-# Keep same perms on rc.openctd.new:
-if [ -e etc/rc.d/rc.openctd ]; then
- cp -a etc/rc.d/rc.openctd etc/rc.d/rc.openctd.new.incoming
- cat etc/rc.d/rc.openctd.new > etc/rc.d/rc.openctd.new.incoming
- mv etc/rc.d/rc.openctd.new.incoming etc/rc.d/rc.openctd.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.openctd.new
+preserve_perms etc/rc.d/rc.openctd.new
config etc/openct.conf.new
config etc/reader.conf.d/reader-openct.conf.new