From e31ee3483534424db71ea37c6979c97d33535fee Mon Sep 17 00:00:00 2001 From: Yenthe Van Ginneken Date: Mon, 17 Oct 2022 12:14:46 +0200 Subject: [PATCH] [ADD] odoo_install: auto install PSQL V14 --- odoo_install.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/odoo_install.sh b/odoo_install.sh index b744cb9..167f243 100644 --- a/odoo_install.sh +++ b/odoo_install.sh @@ -27,6 +27,8 @@ OE_PORT="8069" OE_VERSION="16.0" # Set this to True if you want to install the Odoo enterprise version! IS_ENTERPRISE="False" +# Installs postgreSQL V14 instead of defaults (e.g V12 for Ubuntu 20/22) - this improves performance +INSTALL_POSTGRESQL_FOURTEEN="True" # Set this to True if you want to install Nginx! INSTALL_NGINX="False" # Set the superadmin password - if GENERATE_RANDOM_PASSWORD is set to "True" we will automatically generate a random password, otherwise we use this one @@ -66,7 +68,17 @@ sudo apt-get upgrade -y # Install PostgreSQL Server #-------------------------------------------------- echo -e "\n---- Install PostgreSQL Server ----" -sudo apt-get install postgresql postgresql-server-dev-all -y +if [ $INSTALL_POSTGRESQL_FOURTEEN = "True" ]; then + echo -e "\n---- Installing postgreSQL V14 due to the user it's choise ----" + sudo curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc|sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg + sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' + sudo apt-get update + sudo apt-get install postgresql-14 +else + echo -e "\n---- Installing the default postgreSQL version based on Linux version ----" + sudo apt-get install postgresql postgresql-server-dev-all -y +fi + echo -e "\n---- Creating the ODOO PostgreSQL User ----" sudo su - postgres -c "createuser -s $OE_USER" 2> /dev/null || true