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/remove
zamentur a34cd3abff [enh] Trap error
[fix] Wkhtmltopdf from official repo
[fix] Missing sudo to create postgres user
2015-10-30 18:02:03 +01:00

23 lines
560 B
Bash

#!/bin/bash
app=odoo
domain=$(sudo yunohost app setting $app domain)
instance=$(sudo yunohost app setting $app instance)
# Remove database
sudo -u postgres dropdb ${domain//./-}
# If removing master instance, remove Odoo.
if [ "$instance" = "master" ]; then
# Remove Odoo
sudo yunohost service stop odoo
sudo apt-get remove odoo -y
sudo apt-get remove wkhtmltopdf -y
sudo yunohost service remove odoo
fi
# Remove NGINX conf
sudo rm /etc/nginx/conf.d/$domain.d/$app.conf
# Reload
sudo service nginx reload
sudo yunohost app ssowatconf