mirror of
https://github.com/YunoHost-Apps/lstu_ynh.git
synced 2024-09-03 19:36:12 +02:00
46 lines
1.2 KiB
Text
46 lines
1.2 KiB
Text
|
#!/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 lstu stop
|
||
|
sudo rm "/etc/init.d/lstu"
|
||
|
sudo rm "/etc/default/lstu"
|
||
|
sudo update-rc.d -f lstu remove
|
||
|
fi
|
||
|
if [ -e "/etc/systemd/system/lstu.service" ]; then
|
||
|
echo "Delete systemd script"
|
||
|
sudo service lstu stop
|
||
|
sudo rm "/etc/systemd/system/lstu.service"
|
||
|
sudo systemctl disable lstu.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 lstu service"
|
||
|
sudo yunohost service remove lstu
|
||
|
fi
|
||
|
|
||
|
SECURE_REMOVE '/var/www/$app' # Suppression du dossier de l'application
|
||
|
|
||
|
REMOVE_NGINX_CONF # Suppression de la configuration nginx
|
||
|
|
||
|
|
||
|
SECURE_REMOVE '/var/log/$app/' # Suppression des log
|
||
|
|
||
|
# Régénère la configuration de SSOwat
|
||
|
sudo yunohost app ssowatconf
|
||
|
|
||
|
echo -e "\e[0m" # Restore normal color
|