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