From f4ac66439481681fb1a93b3aeba22be86d6039a2 Mon Sep 17 00:00:00 2001 From: scith Date: Wed, 16 Sep 2015 13:00:17 +0200 Subject: [PATCH] Drop database when removed --- scripts/remove | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/remove b/scripts/remove index 7c585ea..971f0b4 100644 --- a/scripts/remove +++ b/scripts/remove @@ -3,7 +3,10 @@ app=odoo domain=$(sudo yunohost app setting $app domain) 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 # Remove Odoo sudo yunohost service stop odoo @@ -12,8 +15,6 @@ instance=$(sudo yunohost app setting $app instance) sudo apt-get remove wkhtmltopdf -y sudo yunohost service remove odoo sudo yunohost service remove postgresql - else - # Remove database: TO BE DONE fi # Remove NGINX conf