summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Lejeune <sle@openerp.com>2016-06-07 15:36:13 +0200
committerSimon Lejeune <sle@openerp.com>2016-06-07 16:25:21 +0200
commit879e2b27d904e1c67614e7a57cca49ef2872eb97 (patch)
tree8b6cb70180d74e59fc0b6205a67c8fd1273ac9c2
parent7889d7e0fff49d095f8dab2c1bb4261c36de2632 (diff)
[FIX] packaging: redhat: don't write the conf file if already there
this avoid to overwrite the configuration file at each update. closes #11722
-rw-r--r--setup/redhat/postinstall.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/setup/redhat/postinstall.sh b/setup/redhat/postinstall.sh
index a0962cd62ff..bf34016c065 100644
--- a/setup/redhat/postinstall.sh
+++ b/setup/redhat/postinstall.sh
@@ -18,7 +18,9 @@ su - postgres -c "createuser -d -R -S $ODOO_USER" 2> /dev/null || true
# Configuration file
mkdir -p $ODOO_CONFIGURATION_DIR
# can't copy debian config-file as addons_path is not the same
-echo "[options]
+if [ ! -f $ODOO_CONFIGURATION_FILE ]
+then
+ echo "[options]
; This is the password that allows database operations:
; admin_passwd = admin
db_host = False
@@ -27,8 +29,9 @@ db_user = $ODOO_USER
db_password = False
addons_path = /usr/lib/python2.7/site-packages/openerp/addons
" > $ODOO_CONFIGURATION_FILE
-chown $ODOO_USER:$ODOO_GROUP $ODOO_CONFIGURATION_FILE
-chmod 0640 $ODOO_CONFIGURATION_FILE
+ chown $ODOO_USER:$ODOO_GROUP $ODOO_CONFIGURATION_FILE
+ chmod 0640 $ODOO_CONFIGURATION_FILE
+fi
# Log
mkdir -p $ODOO_LOG_DIR
chown $ODOO_USER:$ODOO_GROUP $ODOO_LOG_DIR