2016-04-07 00:00:41 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2016-06-15 23:57:31 +02:00
|
|
|
source .fonctions # Charge les fonctions génériques habituellement utilisées dans le script
|
|
|
|
|
2016-04-07 00:00:41 +02:00
|
|
|
# Récupère les infos de l'application.
|
2016-06-15 23:57:31 +02:00
|
|
|
YNH_VERSION # Récupère le numéro de version de Yunohost.
|
2016-05-20 00:03:02 +02:00
|
|
|
if [ $ynh_version = "2.4" ]; then
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
|
|
|
|
# Source app helpers
|
2016-06-04 23:08:49 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
2016-05-20 00:03:02 +02:00
|
|
|
else
|
|
|
|
app=radicale
|
|
|
|
fi
|
2016-04-07 00:00:41 +02:00
|
|
|
domain=$(sudo yunohost app setting $app domain)
|
|
|
|
|
2016-06-15 23:57:31 +02:00
|
|
|
REMOVE_APP_DIR # Suppression du dossier de l'application
|
2016-05-20 00:03:02 +02:00
|
|
|
if [ -e "/opt/yunohost/$app" ]; then
|
|
|
|
echo "Delete virtualenv"
|
|
|
|
sudo rm -r "/opt/yunohost/$app"
|
|
|
|
fi
|
|
|
|
if [ -e "/etc/$app/" ]; then
|
|
|
|
echo "Delete radicale config"
|
|
|
|
sudo rm -r "/etc/$app/"
|
|
|
|
fi
|
2016-04-07 00:00:41 +02:00
|
|
|
|
2016-05-20 00:03:02 +02:00
|
|
|
# Suppression de la configuration uwsgi
|
2016-04-07 00:00:41 +02:00
|
|
|
# Stoppe le service uwsgi
|
|
|
|
sudo service uwsgi stop
|
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
|
|
|
|
|
|
|
|
if grep -q "^radicale:" /etc/passwd # Test l'existence de l'utilisateur
|
|
|
|
then
|
|
|
|
sudo userdel radicale
|
|
|
|
fi
|
2016-04-07 00:00:41 +02:00
|
|
|
# Redémarre le service uwsgi
|
|
|
|
sudo service uwsgi start
|
|
|
|
|
2016-06-15 23:57:31 +02:00
|
|
|
REMOVE_NGINX_CONF # Suppression de la configuration nginx
|
2016-04-07 00:00:41 +02:00
|
|
|
|
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
|
|
|
|
2016-06-15 23:57:31 +02:00
|
|
|
REMOVE_LOGROTATE_CONF # Suppression de la configuration de logrotate
|
2016-04-07 00:00:41 +02:00
|
|
|
|
2016-06-04 22:20:07 +02:00
|
|
|
if [ $ynh_version != "2.4" ]
|
|
|
|
then
|
|
|
|
# Retire le hook sur la création de nouveaux utilisateurs
|
|
|
|
sudo yunohost hook remove radicale
|
|
|
|
fi
|
2016-04-07 00:00:41 +02:00
|
|
|
|
|
|
|
# Régénère la configuration de SSOwat
|
|
|
|
sudo yunohost app ssowatconf
|
|
|
|
|
2016-05-20 00:03:02 +02:00
|
|
|
echo -e "\e[0m" # Restore normal color
|