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
|
2018-12-20 22:55:17 +01:00
|
|
|
ynh_psql_remove_db $app $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
|