1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/libreerp_ynh.git synced 2024-09-03 19:36:13 +02:00

[fix] Odoo database not deleted

This commit is contained in:
ljf 2016-12-14 11:33:39 +01:00
parent 33c8556bcb
commit 159acba1e8
2 changed files with 7 additions and 4 deletions

View file

@ -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

View file

@ -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