11#! /bin/bash
22# ###############################################################################
3- # Script for installing Odoo V9 on Ubuntu 14.04 LTS (could be used for other version too)
3+ # Script for installing Odoo on Ubuntu 14.04, 15.04 and 16.04 (could be used for other version too)
44# Author: Yenthe Van Ginneken
55# -------------------------------------------------------------------------------
66# This script will install Odoo on your Ubuntu 14.04 server. It can install multiple Odoo instances
@@ -27,6 +27,8 @@ OE_PORT="8069"
2727# Choose the Odoo version which you want to install. For example: 9.0, 8.0, 7.0 or saas-6. When using 'trunk' the master version will be installed.
2828# IMPORTANT! This script contains extra libraries that are specifically needed for Odoo 9.0
2929OE_VERSION=" 9.0"
30+ # Set this to True if you want to install Odoo 9 Enterprise!
31+ IS_ENTERPRISE=" False"
3032# set the superadmin password
3133OE_SUPERADMIN=" admin"
3234OE_CONFIG=" ${OE_USER} -server"
@@ -65,7 +67,9 @@ echo -e "\n---- Install python packages ----"
6567sudo apt-get install python-dateutil python-feedparser python-ldap python-libxslt1 python-lxml python-mako python-openid python-psycopg2 python-pybabel python-pychart python-pydot python-pyparsing python-reportlab python-simplejson python-tz python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi python-docutils python-psutil python-mock python-unittest2 python-jinja2 python-pypdf python-decorator python-requests python-passlib python-pil -y
6668
6769echo -e " \n---- Install python libraries ----"
68- sudo pip install gdata psycogreen ofxparse
70+ sudo pip install gdata psycogreen
71+ # This is for compatibility with Ubuntu 16.04. Will work on 14.04, 15.04 and 16.04
72+ sudo -H pip install suds
6973
7074echo -e " \n--- Install other required packages"
7175sudo apt-get install node-clean-css -y
@@ -106,9 +110,25 @@ sudo chown $OE_USER:$OE_USER /var/log/$OE_USER
106110echo -e " \n==== Installing ODOO Server ===="
107111sudo git clone --depth 1 --branch $OE_VERSION https://www.github.com/odoo/odoo $OE_HOME_EXT /
108112
109- echo -e " \n---- Create custom module directory ----"
110- sudo su $OE_USER -c " mkdir $OE_HOME /custom"
111- sudo su $OE_USER -c " mkdir $OE_HOME /custom/addons"
113+ if [ $IS_ENTERPRISE = " True" ]; then
114+ # Odoo Enterprise install!
115+ echo -e " \n--- Create symlink for node"
116+ sudo ln -s /usr/bin/nodejs /usr/bin/node
117+ sudo su $OE_USER -c " mkdir $OE_HOME /enterprise"
118+ sudo su $OE_USER -c " mkdir $OE_HOME /enterprise/addons"
119+
120+ echo -e " \n---- Adding Enterprise code under $OE_HOME /enterprise/addons ----"
121+ sudo git clone --depth 1 --branch 9.0 https://www.github.com/odoo/enterprise " $OE_HOME /enterprise/addons"
122+
123+ echo -e " \n---- Installing Enterprise specific libraries ----"
124+ sudo apt-get install nodejs npm
125+ sudo npm install -g less
126+ sudo npm install -g less-plugin-clean-css
127+ else
128+ echo -e " \n---- Create custom module directory ----"
129+ sudo su $OE_USER -c " mkdir $OE_HOME /custom"
130+ sudo su $OE_USER -c " mkdir $OE_HOME /custom/addons"
131+ fi
112132
113133echo -e " \n---- Setting permissions on home folder ----"
114134sudo chown -R $OE_USER :$OE_USER $OE_HOME /*
@@ -122,8 +142,12 @@ echo -e "* Change server config file"
122142sudo sed -i s/" db_user = .*" /" db_user = $OE_USER " /g /etc/${OE_CONFIG} .conf
123143sudo sed -i s/" ; admin_passwd.*" /" admin_passwd = $OE_SUPERADMIN " /g /etc/${OE_CONFIG} .conf
124144sudo su root -c " echo 'logfile = /var/log/$OE_USER /$OE_CONFIG $1 .log' >> /etc/${OE_CONFIG} .conf"
125- sudo su root -c " echo 'addons_path=$OE_HOME_EXT /addons,$OE_HOME /custom/addons' >> /etc/${OE_CONFIG} .conf"
126-
145+ if [ $IS_ENTERPRISE = " True" ]; then
146+ sudo su root -c " echo 'addons_path=$OE_HOME /enterprise/addons,$OE_HOME_EXT /addons' >> /etc/${OE_CONFIG} .conf"
147+ else
148+ sudo su root -c " echo 'addons_path=$OE_HOME_EXT /addons,$OE_HOME /custom/addons' >> /etc/${OE_CONFIG} .conf"
149+ fi
150+
127151echo -e " * Create startup file"
128152sudo su root -c " echo '#!/bin/sh' >> $OE_HOME_EXT /start.sh"
129153sudo su root -c " echo 'sudo -u $OE_USER $OE_HOME_EXT /openerp-server --config=/etc/${OE_CONFIG} .conf' >> $OE_HOME_EXT /start.sh"
@@ -151,16 +175,12 @@ PATH=/bin:/sbin:/usr/bin
151175DAEMON=$OE_HOME_EXT /openerp-server
152176NAME=$OE_CONFIG
153177DESC=$OE_CONFIG
154-
155178# Specify the user name (Default: odoo).
156179USER=$OE_USER
157-
158180# Specify an alternate config file (Default: /etc/openerp-server.conf).
159181CONFIGFILE="/etc/${OE_CONFIG} .conf"
160-
161182# pidfile
162183PIDFILE=/var/run/\$ {NAME}.pid
163-
164184# Additional options that are passed to the Daemon.
165185DAEMON_OPTS="-c \$ CONFIGFILE"
166186[ -x \$ DAEMON ] || exit 0
@@ -171,7 +191,6 @@ pid=\`cat \$PIDFILE\`
171191[ -d /proc/\$ pid ] && return 0
172192return 1
173193}
174-
175194case "\$ {1}" in
176195start)
177196echo -n "Starting \$ {DESC}: "
@@ -186,7 +205,6 @@ start-stop-daemon --stop --quiet --pidfile \$PIDFILE \
186205--oknodo
187206echo "\$ {NAME}."
188207;;
189-
190208restart|force-reload)
191209echo -n "Restarting \$ {DESC}: "
192210start-stop-daemon --stop --quiet --pidfile \$ PIDFILE \
@@ -202,7 +220,6 @@ N=/etc/init.d/\$NAME
202220echo "Usage: \$ NAME {start|stop|restart|force-reload}" >&2
203221exit 1
204222;;
205-
206223esac
207224exit 0
208225EOF
0 commit comments