Drop database when removed

This commit is contained in:
scith 2015-09-16 13:00:17 +02:00
parent 6bfa63e5ce
commit f4ac664394

View file

@ -3,7 +3,10 @@ app=odoo
domain=$(sudo yunohost app setting $app domain) domain=$(sudo yunohost app setting $app domain)
instance=$(sudo yunohost app setting $app instance) instance=$(sudo yunohost app setting $app instance)
# If removing master instance, remove Odoo. Else, remove database only # Remove database
sudo -u postgres dropdb ${domain//./-}
# If removing master instance, remove Odoo.
if [ "$instance" = "master" ]; then if [ "$instance" = "master" ]; then
# Remove Odoo # Remove Odoo
sudo yunohost service stop odoo sudo yunohost service stop odoo
@ -12,8 +15,6 @@ instance=$(sudo yunohost app setting $app instance)
sudo apt-get remove wkhtmltopdf -y sudo apt-get remove wkhtmltopdf -y
sudo yunohost service remove odoo sudo yunohost service remove odoo
sudo yunohost service remove postgresql sudo yunohost service remove postgresql
else
# Remove database: TO BE DONE
fi fi
# Remove NGINX conf # Remove NGINX conf