1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/coin_ynh.git synced 2024-09-03 18:16:26 +02:00
coin_ynh/scripts/remove

43 lines
819 B
Text
Raw Normal View History

2017-04-09 11:05:39 +02:00
#!/bin/bash
set -u
# Source YunoHost helpers
source /usr/share/yunohost/helpers
source future.sh
source common.sh
# Retrieve app settings
APP=$YNH_APP_INSTANCE_NAME
app=$APP
DOMAIN=$(ynh_app_setting_get "$APP" domain)
# FIXME FIXME FIXME
# Add tests that stuff actually exists before removing them
# Remove mysql table
2017-08-02 16:26:44 +02:00
ynh_psql_drop_db $app
2018-03-27 16:57:21 +02:00
ynh_psql_drop_user $app
2017-04-09 11:05:39 +02:00
# Remove dependencies
ynh_remove_app_dependencies
# Remove nginx configuration file
sudo rm -f /etc/nginx/conf.d/$DOMAIN.d/$APP.conf
# Remove services
sudo service $APP stop
sudo killall $APP
sudo yunohost service remove $APP
sudo rm -f /etc/systemd/system/$APP.service
sudo systemctl daemon-reload
# Remove sources
ynh_secure_remove /opt/$APP
# Delete system user
ynh_system_user_delete $APP
# Reload nginx service
sudo service nginx reload