2016-04-07 00:00:41 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-03-19 18:36:20 +01:00
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
2016-06-15 23:57:31 +02:00
|
|
|
|
2017-03-19 18:36:20 +01:00
|
|
|
source .fonctions
|
2016-11-08 13:38:29 +01:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2017-03-19 18:36:20 +01:00
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
2016-04-07 00:00:41 +02:00
|
|
|
|
2017-03-19 18:36:20 +01:00
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
2016-11-08 13:13:35 +01:00
|
|
|
|
2017-03-19 18:36:20 +01:00
|
|
|
domain=$(ynh_app_setting_get $app domain)
|
2016-11-08 13:13:35 +01:00
|
|
|
|
2017-03-19 18:36:20 +01:00
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
|
|
|
# STOP AND REMOVE SERVICE
|
|
|
|
#=================================================
|
2016-04-07 00:00:41 +02:00
|
|
|
|
2016-05-20 00:03:02 +02:00
|
|
|
# Suppression de la configuration uwsgi
|
2017-03-19 18:36:20 +01:00
|
|
|
sudo systemctl stop uwsgi
|
2016-05-20 00:03:02 +02:00
|
|
|
if [ -e "/etc/uwsgi/apps-available/radicale.ini" ]; then
|
|
|
|
echo "Delete uwsgi config"
|
|
|
|
sudo rm "/etc/uwsgi/apps-available/radicale.ini"
|
|
|
|
fi
|
2016-06-22 14:11:25 +02:00
|
|
|
if [ -h "/etc/uwsgi/apps-enabled/radicale.ini" ]; then
|
2016-05-20 00:03:02 +02:00
|
|
|
echo "Delete uwsgi config"
|
|
|
|
sudo rm "/etc/uwsgi/apps-enabled/radicale.ini"
|
|
|
|
fi
|
|
|
|
|
2017-03-19 18:36:20 +01:00
|
|
|
#=================================================
|
|
|
|
# REMOVE DEPENDENCIES
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_remove_app_dependencies
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE THE MAIN DIR OF THE APP
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
SECURE_REMOVE '/var/www/$app' # Suppression du dossier de l'application
|
|
|
|
SECURE_REMOVE '/opt/yunohost/$app'
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE THE NGINX CONFIGURATION
|
|
|
|
#=================================================
|
2016-04-07 00:00:41 +02:00
|
|
|
|
2016-06-15 23:57:31 +02:00
|
|
|
REMOVE_NGINX_CONF # Suppression de la configuration nginx
|
2016-04-07 00:00:41 +02:00
|
|
|
|
2017-03-19 18:36:20 +01:00
|
|
|
#=================================================
|
|
|
|
# REMOVE THE PHP-FPM CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
|
2016-06-15 23:57:31 +02:00
|
|
|
REMOVE_FPM_CONF # Suppression de la configuration du pool php-fpm
|
2016-04-07 00:00:41 +02:00
|
|
|
|
2017-03-19 18:36:20 +01:00
|
|
|
#=================================================
|
|
|
|
# REMOVE THE LOGROTATE CONFIG
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_remove_logrotate # Suppression de la configuration de logrotate
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SPECIFIC REMOVE
|
|
|
|
#=================================================
|
|
|
|
# REMOVE RADICALE'S CONFIG
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
SECURE_REMOVE '/etc/$app/' # Delete radicale config
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# DISABLE SERVICE IN ADMIN PANEL
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
if [ -e /etc/init.d/uwsgi ]
|
|
|
|
then
|
|
|
|
# Redémarre le service uwsgi si il n'est pas désinstallé.
|
|
|
|
sudo systemctl start uwsgi
|
|
|
|
else
|
|
|
|
if sudo yunohost service status | grep -q uwsgi # Test l'existence du service dans Yunohost
|
|
|
|
then
|
|
|
|
echo "Remove uwsgi service"
|
|
|
|
sudo yunohost service remove uwsgi
|
|
|
|
fi
|
|
|
|
fi
|
2016-04-07 00:00:41 +02:00
|
|
|
|
2017-03-19 18:36:20 +01:00
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALISATION
|
|
|
|
#=================================================
|
|
|
|
# REMOVE DEDICATED USER
|
|
|
|
#=================================================
|
2016-04-07 00:00:41 +02:00
|
|
|
|
2017-03-19 18:36:20 +01:00
|
|
|
ynh_system_user_delete $app
|