1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ihatemoney_ynh.git synced 2024-09-03 19:26:15 +02:00
ihatemoney_ynh/scripts/remove
Jocelyn Delalande 321d6cb2d9 Use ynh helpers for error handling
Instead of doing it by hand.

Also we now rely on the fact ynh automatically runs uninstall script if the
install fails. So no more need for manual cleanup.
2018-12-18 18:28:00 +01:00

37 lines
825 B
Bash
Executable file

#!/bin/bash
# Source YunoHost helpers
source /usr/share/yunohost/helpers
# supervisord and other Debian dependencies remain installed
# there is no way to know if they are used by other programs
# Retrieve arguments
app=ihatemoney
domain=$(ynh_app_setting_get $app domain)
db_user=$app
db_name=$app
root_pwd=$(sudo cat /etc/yunohost/mysql)
# Stop service
sudo supervisorctl stop budget
# Drop database
ynh_mysql_drop_db $db_name
ynh_mysql_drop_user $db_user
# Remove src and venv
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 systemctl force-reload supervisor
sudo systemctl reload nginx
sudo yunohost app ssowatconf
# Delete user
sudo userdel ihatemoney