1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/libreerp_ynh.git synced 2024-09-03 19:36:13 +02:00
libreerp_ynh/scripts/install
2015-09-14 17:48:30 +02:00

55 lines
No EOL
1.3 KiB
Bash

#!/bin/bash
app=odoo
set -e
# Retrieve arguments
domain=$1
is_public=$2
odoo_version=$3
admin_password=$4
sudo yunohost app checkport 8069
if [[ ! $? -eq 0 ]]; then
exit 1
fi
# Check domain/path availability
domain=${domain}"/"
sudo yunohost app checkurl $domain -a $app \
|| (echo "Path not available: $domain" && exit 1)
# Remove trailing "/" for next commands
domain=${domain%/}
sudo yunohost app setting $app domain -v $domain
# Install Odoo
# Prepare installation
sudo apt-get -y install curl
# Install Odoo
sudo curl -sS https://nightly.odoo.com/odoo.key | sudo apt-key add -
sudo sh -c 'echo "deb http://nightly.odoo.com/8.0/nightly/deb/ ./" > /etc/apt/sources.list.d/odoo.list'
sudo apt-get update
sudo apt-get -y install wkhtmltopdf
sudo apt-get -y install odoo
# Copy conf file
sudo sed -i "s@ADMIN_PASSWORD@$admin_password@g" ../conf/odoo-server.conf
sudo cp ../conf/odoo-server.conf /etc/odoo-server.conf
# Add services
sudo yunohost service add postgresql
sudo yunohost service add odoo
sudo yunohost service stop odoo
sudo yunohost service start odoo
# Configure Nginx and reload
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
if [ "$is_public" = "Yes" ];
then
sudo yunohost app setting $app skipped_uris -v "/"
fi
sudo service nginx reload
echo $?