From 159acba1e82bc8290be642ea63c7662741f41c6a Mon Sep 17 00:00:00 2001 From: ljf Date: Wed, 14 Dec 2016 11:33:39 +0100 Subject: [PATCH] [fix] Odoo database not deleted --- scripts/install | 6 +++--- scripts/remove | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 5646c21..2eff5b6 100644 --- a/scripts/install +++ b/scripts/install @@ -41,8 +41,8 @@ else echo "Installing odoo" - dbname=$app - dbuser=$app + dbname=$APPNAME + dbuser=$APPNAME # Generate random password # Fix a bug on ynh_string_random https://github.com/YunoHost/yunohost/pull/205/commits/0d6cf499a0b858e7009245fd11a9210188047c13 dbpass=$(ynh_string_random | sed "s/\[/e/g" | sed "s/\]/e/g") @@ -50,7 +50,7 @@ else ynh_app_setting_set "$app" version "$odoo_version" ynh_app_setting_set "$app" instance "master" ynh_app_setting_set "$app" psqlpwd "$dbpass" - + # Install Odoo # Prepare installation ynh_package_install curl diff --git a/scripts/remove b/scripts/remove index 689737b..4c6fc59 100644 --- a/scripts/remove +++ b/scripts/remove @@ -25,10 +25,13 @@ if [ "$instance" = "master" ]; then ynh_package_remove wkhtmltopdf sudo rm -f /etc/odoo/openerp-server.conf sudo yunohost service remove odoo + ynh_psql_drop_db $APPNAME + ynh_psql_drop_user $APPNAME fi # Remove database -sudo su -c "dropdb $database" postgres +ynh_psql_drop_db $database +ynh_psql_drop_user $database if [ "$instance" = "slave" ]; then sudo yunohost service start odoo