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

41 lines
969 B
Text
Raw Normal View History

2015-03-19 20:49:50 +01:00
#!/bin/bash
2015-11-18 00:28:42 +01:00
2015-03-19 20:49:50 +01:00
app=lutim
2015-11-18 00:28:42 +01:00
# Récupère les infos de l'application.
2015-03-19 20:49:50 +01:00
domain=$(sudo yunohost app setting $app domain)
2016-03-31 22:41:54 +02:00
codename=$(sudo yunohost app setting $app codename)
2015-03-26 13:07:01 +01:00
2015-11-18 00:28:42 +01:00
# Arrêt du service
2015-03-19 20:49:50 +01:00
sudo service lutim stop
2015-03-26 13:07:01 +01:00
2015-11-18 00:28:42 +01:00
# Retire le service du monitoring de Yunohost.
sudo yunohost service remove lutim
2015-03-26 13:07:01 +01:00
2016-03-31 22:41:54 +02:00
if [ "$codename" = "wheezy" ]
then # Suppression des fichiers init
sudo rm -f /etc/default/lutim
sudo rm -f /etc/init.d/lutim
sudo update-rc.d -f lutim remove
else # Suppression des fichiers systemd
sudo systemctl disable lutim.service
sudo rm -f /etc/systemd/system/lutim.service
fi
2015-03-26 13:07:01 +01:00
2015-11-18 00:28:42 +01:00
# Suppression du dossier de l'application
sudo rm -rf /var/www/$app
# Suppression de la configuration nginx
sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf
2015-03-26 13:07:01 +01:00
# Retirer le cron
sudo rm -f /etc/cron.d/$app
# Suppression des log
sudo rm -r /var/log/$app/
2015-11-18 00:28:42 +01:00
# Recharge la configuration Nginx
2015-03-26 13:07:01 +01:00
sudo service nginx reload
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