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

96 lines
2.8 KiB
Text
Raw Normal View History

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-20 00:17:59 +01:00
source _common.sh
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-09-05 00:34:00 +02:00
systemctl stop uwsgi
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"
2017-06-13 22:28:52 +02:00
ynh_secure_remove "/etc/uwsgi/apps-enabled/radicale.ini"
2016-05-20 00:03:02 +02:00
fi
2017-06-13 22:28:52 +02:00
ynh_secure_remove "/etc/uwsgi/apps-available/radicale.ini"
2016-05-20 00:03:02 +02:00
2017-03-19 18:36:20 +01:00
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_remove_app_dependencies
#=================================================
# REMOVE THE MAIN DIR OF THE APP
#=================================================
2017-06-13 22:28:52 +02:00
ynh_secure_remove "/var/www/$app" # Suppression du dossier de l'application
ynh_secure_remove "/opt/yunohost/$app"
2017-03-19 18:36:20 +01:00
#=================================================
# REMOVE THE NGINX CONFIGURATION
#=================================================
2016-04-07 00:00:41 +02:00
2017-06-13 22:28:52 +02:00
ynh_remove_nginx_config # 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
#=================================================
2017-06-13 22:28:52 +02:00
ynh_remove_fpm_config # 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
#=================================================
2017-06-13 22:28:52 +02:00
ynh_secure_remove "/etc/$app" # Delete radicale config
2017-03-19 18:36:20 +01:00
#=================================================
# DISABLE SERVICE IN ADMIN PANEL
#=================================================
if [ -e /etc/init.d/uwsgi ]
then
# Redémarre le service uwsgi si il n'est pas désinstallé.
2017-09-05 00:34:00 +02:00
systemctl start uwsgi
2017-03-19 18:36:20 +01:00
else
2017-09-05 00:34:00 +02:00
if yunohost service status | grep -q uwsgi # Test l'existence du service dans Yunohost
2017-03-19 18:36:20 +01:00
then
echo "Remove uwsgi service"
2017-09-05 00:34:00 +02:00
yunohost service remove uwsgi
2017-03-19 18:36:20 +01:00
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