2017-02-07 22:55:13 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-04-01 16:53:29 +02:00
|
|
|
# Exit on command errors and treat unset variables as an error
|
|
|
|
set -u
|
|
|
|
|
2017-02-07 22:55:13 +01:00
|
|
|
source .fonctions # Charge les fonctions génériques habituellement utilisées dans le script
|
2017-04-01 16:53:29 +02:00
|
|
|
source /usr/share/yunohost/helpers # Source app helpers
|
2017-02-07 22:55:13 +01:00
|
|
|
|
|
|
|
# Récupère les infos de l'application.
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
|
|
|
|
domain=$(ynh_app_setting_get $app domain)
|
|
|
|
|
|
|
|
# Arrêt du service
|
|
|
|
if [ -e "/etc/systemd/system/lufi.service" ]; then
|
|
|
|
echo "Delete systemd script"
|
|
|
|
sudo service lufi stop
|
|
|
|
sudo rm "/etc/systemd/system/lufi.service"
|
|
|
|
sudo systemctl disable lufi.service
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Retire le service du monitoring de Yunohost.
|
|
|
|
if sudo yunohost service status | grep -q lufi # Test l'existence du service dans Yunohost
|
|
|
|
then
|
|
|
|
echo "Remove lufi service"
|
|
|
|
sudo yunohost service remove lufi
|
|
|
|
fi
|
|
|
|
|
|
|
|
SECURE_REMOVE '/var/www/$app' # Suppression du dossier de l'application
|
|
|
|
|
|
|
|
REMOVE_NGINX_CONF # Suppression de la configuration nginx
|
|
|
|
|
|
|
|
# Retirer le cron
|
|
|
|
if [ -e "/etc/cron.d/$app" ]; then
|
|
|
|
echo "Delete cron"
|
|
|
|
sudo rm "/etc/cron.d/$app"
|
|
|
|
fi
|
|
|
|
|
|
|
|
SECURE_REMOVE '/var/log/$app/' # Suppression des log
|
|
|
|
|
|
|
|
REMOVE_LOGROTATE_CONF # Suppression de la configuration de logrotate
|
|
|
|
|
2017-04-01 16:53:29 +02:00
|
|
|
ynh_package_remove carton || echo "ShellInABox already uninstalled"
|
|
|
|
ynh_package_remove perlmagick || echo "perlmagick already uninstalled"
|
|
|
|
|
2017-02-07 22:55:13 +01:00
|
|
|
# Régénère la configuration de SSOwat
|
|
|
|
sudo yunohost app ssowatconf
|
|
|
|
|
|
|
|
echo -e "\e[0m" # Restore normal color
|