#!/usr/bin/env bash . ./env_var.sh EL_USER=${USER} #EL_INSTALL_WKHTMLTOPDF="True" ## ### WKHTMLTOPDF download links ## === Ubuntu Trusty x64 & x32 === (for other distributions please replace these two links, ## in order to have correct version of wkhtmltopdf installed, for a danger note refer to ## https://github.com/odoo/odoo/wiki/Wkhtmltopdf ): WKHTMLTOX_X64=https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.trusty_amd64.deb WKHTMLTOX_X32=https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.trusty_i386.deb #-------------------------------------------------- # Update Server #-------------------------------------------------- echo -e "\n---- Update Server ----" # add-apt-repository can install add-apt-repository Ubuntu 18.x sudo apt-get install software-properties-common curl -y # universe package is for Ubuntu 18.x sudo add-apt-repository universe # libpng12-0 dependency for wkhtmltopdf sudo add-apt-repository "deb http://mirrors.kernel.org/ubuntu/ xenial main" sudo apt-get update sudo apt-get upgrade -y #-------------------------------------------------- # Install PostgreSQL Server #-------------------------------------------------- echo -e "\n---- Install PostgreSQL Server ----" sudo apt-get install postgresql libpq-dev -y echo -e "\n---- Creating the ERPLibre PostgreSQL User ----" sudo su - postgres -c "createuser -s ${EL_USER}" 2> /dev/null || true #-------------------------------------------------- # Install Dependencies #-------------------------------------------------- echo -e "\n--- Installing debian dependancy --" sudo apt-get install git build-essential wget libxslt-dev libzip-dev libldap2-dev libsasl2-dev node-less libpng12-0 gdebi-core libffi-dev -y sudo apt-get install libmariadbd-dev -y echo -e "\n---- Installing nodeJS NPM and rtlcss for LTR support ----" sudo apt-get install nodejs npm -y sudo npm install -g rtlcss sudo npm install -g lessc if [ ${EL_INSTALL_NGINX} = "True" ]; then echo -e "\n---- Installing nginx ----" sudo apt install nginx -y fi #-------------------------------------------------- # Install Wkhtmltopdf if needed #-------------------------------------------------- if [ ${EL_INSTALL_WKHTMLTOPDF} = "True" ]; then echo -e "\n---- Installing wkhtml ----" INSTALLED=$(dpkg -s wkhtmltox|grep installed) if [ "" == "${INSTALLED}" ]; then echo -e "\n---- Install wkhtml and place shortcuts on correct place ----" #pick up correct one from x64 & x32 versions: if [ "`getconf LONG_BIT`" == "64" ];then _url=${WKHTMLTOX_X64} else _url=${WKHTMLTOX_X32} fi sudo wget ${_url} sudo gdebi --n `basename ${_url}` sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin sudo ln -s /usr/local/bin/wkhtmltoimage /usr/bin else echo -e "\n---- Already installed wkhtml ----" fi else echo "Wkhtmltopdf isn't installed due to the choice of the user!" fi