1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/lutim_ynh.git synced 2024-09-03 19:36:24 +02:00
lutim_ynh/scripts/remove

61 lines
1.5 KiB
Text
Raw Normal View History

2015-03-19 20:49:50 +01:00
#!/bin/bash
2015-11-18 00:28:42 +01:00
2016-06-15 23:56:45 +02:00
source .fonctions # Charge les fonctions génériques habituellement utilisées dans le script
2015-11-18 00:28:42 +01:00
# Récupère les infos de l'application.
2016-06-15 23:56:45 +02:00
YNH_VERSION # Récupère le numéro de version de Yunohost.
2016-05-20 00:01:21 +02:00
if [ $ynh_version = "2.4" ]; then
app=$YNH_APP_INSTANCE_NAME
# Source app helpers
2016-06-04 23:09:27 +02:00
source /usr/share/yunohost/helpers
2016-05-20 00:01:21 +02:00
else
app=lutim
fi
2015-03-19 20:49:50 +01:00
domain=$(sudo yunohost app setting $app domain)
2015-03-26 13:07:01 +01:00
2015-11-18 00:28:42 +01:00
# Arrêt du service
2016-05-20 00:01:21 +02:00
if [ -e "/etc/init.d/lutim" ]; then
echo "Delete init.d script"
sudo service lutim stop
sudo rm "/etc/init.d/lutim"
sudo rm "/etc/default/lutim"
2016-03-31 22:41:54 +02:00
sudo update-rc.d -f lutim remove
2016-05-20 00:01:21 +02:00
fi
if [ -e "/etc/systemd/system/lutim.service" ]; then
echo "Delete systemd script"
sudo service lutim stop
sudo rm "/etc/systemd/system/lutim.service"
2016-03-31 22:41:54 +02:00
sudo systemctl disable lutim.service
2016-05-20 00:01:21 +02:00
fi
# Retire le service du monitoring de Yunohost.
if sudo yunohost service status | grep -q lutim # Test l'existence du service dans Yunohost
then
echo "Remove lutim service"
sudo yunohost service remove lutim
2016-03-31 22:41:54 +02:00
fi
2015-03-26 13:07:01 +01:00
2016-06-15 23:56:45 +02:00
REMOVE_APP_DIR # Suppression du dossier de l'application
2015-11-18 00:28:42 +01:00
2016-06-15 23:56:45 +02:00
REMOVE_NGINX_CONF # Suppression de la configuration nginx
2015-11-18 00:28:42 +01:00
2015-03-26 13:07:01 +01:00
# Retirer le cron
2016-05-20 00:01:21 +02:00
if [ -e "/etc/cron.d/$app" ]; then
echo "Delete cron"
sudo rm "/etc/cron.d/$app"
fi
2015-03-26 13:07:01 +01:00
# Suppression des log
2016-05-20 00:01:21 +02:00
if [ -e "/var/log/$app/" ]; then
echo "Delete log"
sudo rm -r "/var/log/$app/"
fi
2015-03-26 13:07:01 +01:00
2016-06-15 23:56:45 +02:00
REMOVE_LOGROTATE_CONF # Suppression de la configuration de logrotate
2016-05-15 11:36:31 +02:00
2015-11-18 00:28:42 +01:00
# Régénère la configuration de SSOwat
2015-03-26 13:07:01 +01:00
sudo yunohost app ssowatconf
2016-05-20 00:01:21 +02:00
echo -e "\e[0m" # Restore normal color