mirror of
https://github.com/YunoHost-Apps/radicale_ynh.git
synced 2024-09-03 20:16:14 +02:00
98 lines
2.8 KiB
Bash
98 lines
2.8 KiB
Bash
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC STARTING
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source .fonctions
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# LOAD SETTINGS
|
|
#=================================================
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
domain=$(ynh_app_setting_get $app domain)
|
|
|
|
#=================================================
|
|
# STANDARD REMOVE
|
|
#=================================================
|
|
# STOP AND REMOVE SERVICE
|
|
#=================================================
|
|
|
|
# Suppression de la configuration uwsgi
|
|
sudo systemctl stop uwsgi
|
|
if [ -e "/etc/uwsgi/apps-available/radicale.ini" ]; then
|
|
echo "Delete uwsgi config"
|
|
sudo rm "/etc/uwsgi/apps-available/radicale.ini"
|
|
fi
|
|
if [ -h "/etc/uwsgi/apps-enabled/radicale.ini" ]; then
|
|
echo "Delete uwsgi config"
|
|
sudo rm "/etc/uwsgi/apps-enabled/radicale.ini"
|
|
fi
|
|
|
|
#=================================================
|
|
# 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
|
|
#=================================================
|
|
|
|
REMOVE_NGINX_CONF # Suppression de la configuration nginx
|
|
|
|
#=================================================
|
|
# REMOVE THE PHP-FPM CONFIGURATION
|
|
#=================================================
|
|
|
|
REMOVE_FPM_CONF # Suppression de la configuration du pool php-fpm
|
|
|
|
#=================================================
|
|
# 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
|
|
|
|
#=================================================
|
|
# GENERIC FINALISATION
|
|
#=================================================
|
|
# REMOVE DEDICATED USER
|
|
#=================================================
|
|
|
|
ynh_system_user_delete $app
|