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" echo "Installing odoo"
dbname=$app dbname=$APPNAME
dbuser=$app dbuser=$APPNAME
# Generate random password # Generate random password
# Fix a bug on ynh_string_random https://github.com/YunoHost/yunohost/pull/205/commits/0d6cf499a0b858e7009245fd11a9210188047c13 # 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") 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" version "$odoo_version"
ynh_app_setting_set "$app" instance "master" ynh_app_setting_set "$app" instance "master"
ynh_app_setting_set "$app" psqlpwd "$dbpass" ynh_app_setting_set "$app" psqlpwd "$dbpass"
# Install Odoo # Install Odoo
# Prepare installation # Prepare installation
ynh_package_install curl ynh_package_install curl

View file

@ -25,10 +25,13 @@ if [ "$instance" = "master" ]; then
ynh_package_remove wkhtmltopdf ynh_package_remove wkhtmltopdf
sudo rm -f /etc/odoo/openerp-server.conf sudo rm -f /etc/odoo/openerp-server.conf
sudo yunohost service remove odoo sudo yunohost service remove odoo
ynh_psql_drop_db $APPNAME
ynh_psql_drop_user $APPNAME
fi fi
# Remove database # Remove database
sudo su -c "dropdb $database" postgres ynh_psql_drop_db $database
ynh_psql_drop_user $database
if [ "$instance" = "slave" ]; then if [ "$instance" = "slave" ]; then
sudo yunohost service start odoo sudo yunohost service start odoo