2015-09-14 17:12:17 +02:00
|
|
|
#!/bin/bash
|
2015-09-14 18:13:54 +02:00
|
|
|
app=odoo
|
2015-09-16 10:17:50 +02:00
|
|
|
domain=$(sudo yunohost app setting $app domain)
|
2015-09-20 08:34:07 +02:00
|
|
|
database=${domain//./-}
|
2015-09-16 10:17:50 +02:00
|
|
|
instance=$(sudo yunohost app setting $app instance)
|
2015-09-14 17:12:17 +02:00
|
|
|
|
2015-09-16 13:00:17 +02:00
|
|
|
# Remove database
|
2015-09-20 08:34:07 +02:00
|
|
|
sudo -u postgres dropdb $database
|
2015-09-16 13:00:17 +02:00
|
|
|
|
|
|
|
# If removing master instance, remove Odoo.
|
2015-09-16 10:17:50 +02:00
|
|
|
if [ "$instance" = "master" ]; then
|
|
|
|
# Remove Odoo
|
|
|
|
sudo yunohost service stop odoo
|
|
|
|
sudo apt-get remove odoo -y
|
|
|
|
sudo apt-get remove wkhtmltopdf -y
|
|
|
|
sudo yunohost service remove odoo
|
|
|
|
fi
|
|
|
|
|
2015-09-14 17:12:17 +02:00
|
|
|
# Remove NGINX conf
|
|
|
|
sudo rm /etc/nginx/conf.d/$domain.d/$app.conf
|
|
|
|
|
|
|
|
# Reload
|
|
|
|
sudo service nginx reload
|
2015-10-30 18:02:03 +01:00
|
|
|
sudo yunohost app ssowatconf
|