mirror of
https://github.com/YunoHost-Apps/lutim_ynh.git
synced 2024-09-03 19:36:24 +02:00
52 lines
1.3 KiB
Bash
52 lines
1.3 KiB
Bash
#!/bin/bash
|
|
|
|
source .fonctions # Charge les fonctions génériques habituellement utilisées dans le script
|
|
|
|
# Récupère les infos de l'application.
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
# Source app helpers
|
|
source /usr/share/yunohost/helpers
|
|
|
|
domain=$(ynh_app_setting_get $app domain)
|
|
|
|
# Arrêt du service
|
|
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"
|
|
sudo update-rc.d -f lutim remove
|
|
fi
|
|
if [ -e "/etc/systemd/system/lutim.service" ]; then
|
|
echo "Delete systemd script"
|
|
sudo service lutim stop
|
|
sudo rm "/etc/systemd/system/lutim.service"
|
|
sudo systemctl disable lutim.service
|
|
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
|
|
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
|
|
|
|
# Régénère la configuration de SSOwat
|
|
sudo yunohost app ssowatconf
|
|
|
|
echo -e "\e[0m" # Restore normal color
|