[fix] Odoo database not deleted
This commit is contained in:
parent
33c8556bcb
commit
159acba1e8
2 changed files with 7 additions and 4 deletions
|
@ -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")
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue