2015-05-02 12:48:23 +02:00
|
|
|
#!/bin/bash
|
2017-03-18 19:12:51 +01:00
|
|
|
set -u
|
2015-05-02 12:48:23 +02:00
|
|
|
|
2017-03-18 19:14:28 +01:00
|
|
|
# Source YunoHost helpers
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2015-05-02 12:48:23 +02:00
|
|
|
# supervisord and other Debian dependencies remain installed
|
|
|
|
# there is no way to know if they are used by other programs
|
|
|
|
|
|
|
|
# Retrieve arguments
|
2017-03-18 19:14:28 +01:00
|
|
|
app=ihatemoney
|
|
|
|
domain=$(ynh_app_setting_get $app domain)
|
|
|
|
db_user=$app
|
|
|
|
db_name=$app
|
2015-05-02 12:48:23 +02:00
|
|
|
root_pwd=$(sudo cat /etc/yunohost/mysql)
|
|
|
|
|
|
|
|
# Drop database
|
|
|
|
mysql -u root -p$root_pwd -e "DROP DATABASE $db_name ; DROP USER $db_user@localhost ;"
|
|
|
|
|
|
|
|
# Remove src
|
|
|
|
sudo rm -rf /opt/yunohost/ihatemoney/
|
|
|
|
|
|
|
|
# Remove settings
|
|
|
|
sudo rm -rf /etc/ihatemoney
|
|
|
|
sudo rm /etc/supervisor/conf.d/ihatemoney.conf
|
|
|
|
sudo rm /etc/nginx/conf.d/$domain.d/ihatemoney.conf
|
|
|
|
|
|
|
|
# Restart services
|
|
|
|
sudo supervisorctl stop budget
|
|
|
|
sudo service supervisor force-reload
|
|
|
|
sudo service nginx reload
|
|
|
|
sudo yunohost app ssowatconf
|
|
|
|
|
|
|
|
# Delete user
|
|
|
|
sudo userdel ihatemoney
|