2014-12-09 21:00:17 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-03-19 18:28:38 +01:00
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
2014-12-09 21:00:17 +01:00
|
|
|
|
2017-03-19 18:28:38 +01:00
|
|
|
source .fonctions
|
2016-11-30 17:49:37 +01:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2017-03-19 18:28:38 +01:00
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
|
2016-11-30 17:55:46 +01:00
|
|
|
domain=$(ynh_app_setting_get $app domain)
|
|
|
|
|
2017-03-19 18:28:38 +01:00
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
|
|
|
# DISABLE SERVICE IN ADMIN PANEL
|
|
|
|
#=================================================
|
2016-11-30 17:49:37 +01:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2017-03-19 18:28:38 +01:00
|
|
|
#=================================================
|
|
|
|
# REMOVE DEPENDENCIES
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_remove_app_dependencies
|
|
|
|
|
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
|
|
|
|
2017-03-19 18:28:38 +01:00
|
|
|
#=================================================
|
|
|
|
# REMOVE THE MAIN DIR OF THE APP
|
|
|
|
#=================================================
|
2014-12-16 00:14:01 +01:00
|
|
|
|
2017-03-19 18:28:38 +01:00
|
|
|
SECURE_REMOVE '/var/lib/$app' # Suppression du dossier de l'application, si il y a des
|
2016-11-30 17:49:37 +01:00
|
|
|
|
2017-03-19 18:28:38 +01:00
|
|
|
#=================================================
|
|
|
|
# REMOVE THE NGINX CONFIGURATION
|
|
|
|
#=================================================
|
2016-11-30 17:49:37 +01:00
|
|
|
|
2017-03-19 18:28:38 +01:00
|
|
|
REMOVE_NGINX_CONF # Suppression de la configuration nginx résidus.
|