2014-12-09 21:00:17 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2016-11-30 17:49:37 +01:00
|
|
|
source .fonctions # Charge les fonctions génériques habituellement utilisées dans le script
|
2014-12-09 21:00:17 +01:00
|
|
|
|
2016-11-30 17:49:37 +01:00
|
|
|
# Récupère les infos de l'application.
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
2014-12-09 21:00:17 +01:00
|
|
|
|
2016-11-30 17:49:37 +01:00
|
|
|
# Source app helpers
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2016-11-30 17:55:46 +01:00
|
|
|
domain=$(ynh_app_setting_get $app domain)
|
|
|
|
|
2016-11-30 17:49:37 +01:00
|
|
|
|
|
|
|
# Retire le service du monitoring de Yunohost.
|
|
|
|
if sudo yunohost service status | grep -q $app # Test l'existence du service dans Yunohost
|
|
|
|
then
|
|
|
|
echo "Remove $app service"
|
|
|
|
sudo yunohost service remove $app
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Supprime Jenkins
|
2014-12-16 08:15:09 +01:00
|
|
|
sudo apt-get purge jenkins -y
|
2014-12-09 21:00:17 +01:00
|
|
|
sudo rm /etc/apt/sources.list.d/jenkins.list
|
2016-11-30 17:49:37 +01:00
|
|
|
# Récupère l'id de la clé APT de jenkins
|
|
|
|
apt_key=$(sudo apt-key list | grep -B1 "Kohsuke Kawaguchi" | grep pub | cut -d'/' -f2 | cut -d' ' -f1)
|
|
|
|
sudo apt-key del $apt_key # Supprime la clé APT
|
2014-12-09 21:00:17 +01:00
|
|
|
sudo apt-get update
|
2014-12-16 00:14:01 +01:00
|
|
|
|
2016-11-30 17:49:37 +01:00
|
|
|
# Régénère la configuration de SSOwat
|
2014-12-16 00:14:01 +01:00
|
|
|
sudo yunohost app ssowatconf
|
|
|
|
|
2016-11-30 17:49:37 +01:00
|
|
|
REMOVE_NGINX_CONF # Suppression de la configuration nginx
|
|
|
|
|
|
|
|
SECURE_REMOVE '/var/lib/$app' # Suppression du dossier de l'application, si il y a des résidus.
|
|
|
|
|
|
|
|
echo -e "\e[0m" # Restore normal color
|