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
2017-06-19 01:53:45 +02:00

34 lines
805 B
Bash
Executable file

#!/bin/bash
set -u
# 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)
# 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
# Delete user
sudo userdel ihatemoney