|
13 | 13 | # Execute the script to install Odoo: |
14 | 14 | # ./odoo-install |
15 | 15 | ################################################################################ |
16 | | - |
| 16 | + |
17 | 17 | ##fixed parameters |
18 | 18 | #odoo |
19 | 19 | OE_USER="odoo" |
@@ -147,19 +147,20 @@ echo -e "\n---- Setting permissions on home folder ----" |
147 | 147 | sudo chown -R $OE_USER:$OE_USER $OE_HOME/* |
148 | 148 |
|
149 | 149 | echo -e "* Create server config file" |
150 | | -sudo cp $OE_HOME_EXT/debian/odoo.conf /etc/${OE_CONFIG}.conf |
151 | | -sudo chown $OE_USER:$OE_USER /etc/${OE_CONFIG}.conf |
152 | | -sudo chmod 640 /etc/${OE_CONFIG}.conf |
153 | 150 |
|
154 | | -echo -e "* Change server config file" |
155 | | -sudo sed -i s/"db_user = .*"/"db_user = $OE_USER"/g /etc/${OE_CONFIG}.conf |
156 | | -sudo sed -i s/"; admin_passwd.*"/"admin_passwd = $OE_SUPERADMIN"/g /etc/${OE_CONFIG}.conf |
157 | | -sudo su root -c "echo 'logfile = /var/log/$OE_USER/$OE_CONFIG$1.log' >> /etc/${OE_CONFIG}.conf" |
158 | | -if [ $IS_ENTERPRISE = "True" ]; then |
159 | | - sudo su root -c "echo 'addons_path=$OE_HOME/enterprise/addons,$OE_HOME_EXT/addons' >> /etc/${OE_CONFIG}.conf" |
| 151 | +sudo touch /etc/${OE_CONFIG}.conf |
| 152 | +echo -e "* Creating server config file" |
| 153 | +sudo su root -c "printf '[options] \n; This is the password that allows database operations:\n' >> /etc/${OE_CONFIG}.conf" |
| 154 | +sudo su root -c "printf 'admin_passwd = ${OE_SUPERADMIN}\n' >> /etc/${OE_CONFIG}.conf" |
| 155 | +sudo su root -c "printf 'xmlrpc_port = ${OE_PORT}\n' >> /etc/${OE_CONFIG}.conf" |
| 156 | +sudo su root -c "printf 'logfile = /var/log/${OE_USER}/${OE_CONFIG}\n' >> /etc/${OE_CONFIG}.conf" |
| 157 | +if [ $IS_ENTERPRISE = "True" ]; then |
| 158 | + sudo su root -c "printf 'addons_path=${OE_HOME}/enterprise/addons,${OE_HOME_EXT}/addons\n' >> /etc/${OE_CONFIG}.conf" |
160 | 159 | else |
161 | | - sudo su root -c "echo 'addons_path=$OE_HOME_EXT/addons,$OE_HOME/custom/addons' >> /etc/${OE_CONFIG}.conf" |
| 160 | + sudo su root -c "printf 'addons_path=${OE_HOME_EXT}/addons,${OE_HOME}/custom/addons\n' >> /etc/${OE_CONFIG}.conf" |
162 | 161 | fi |
| 162 | +sudo chown $OE_USER:$OE_USER /etc/${OE_CONFIG}.conf |
| 163 | +sudo chmod 640 /etc/${OE_CONFIG}.conf |
163 | 164 |
|
164 | 165 | echo -e "* Create startup file" |
165 | 166 | sudo su root -c "echo '#!/bin/sh' >> $OE_HOME_EXT/start.sh" |
@@ -242,9 +243,6 @@ sudo mv ~/$OE_CONFIG /etc/init.d/$OE_CONFIG |
242 | 243 | sudo chmod 755 /etc/init.d/$OE_CONFIG |
243 | 244 | sudo chown root: /etc/init.d/$OE_CONFIG |
244 | 245 |
|
245 | | -echo -e "* Change default xmlrpc port" |
246 | | -sudo su root -c "echo 'xmlrpc_port = $OE_PORT' >> /etc/${OE_CONFIG}.conf" |
247 | | - |
248 | 246 | echo -e "* Start ODOO on Startup" |
249 | 247 | sudo update-rc.d $OE_CONFIG defaults |
250 | 248 |
|
|
0 commit comments