2015-03-19 20:49:50 +01:00
|
|
|
#!/bin/bash
|
2015-11-18 00:28:42 +01:00
|
|
|
|
2017-03-19 19:16:10 +01:00
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
2016-06-15 23:56:45 +02:00
|
|
|
|
2017-03-21 00:44:14 +01:00
|
|
|
source _common.sh
|
2016-11-08 13:33:28 +01:00
|
|
|
source /usr/share/yunohost/helpers
|
2016-05-20 00:01:21 +02:00
|
|
|
|
2017-03-19 19:16:10 +01:00
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
|
2016-12-14 16:10:00 +01:00
|
|
|
domain=$(ynh_app_setting_get $app domain)
|
2015-03-26 13:07:01 +01:00
|
|
|
|
2017-03-19 19:16:10 +01:00
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
|
|
|
# STOP AND REMOVE SERVICE
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
if [ -e "/etc/systemd/system/$app.service" ]; then
|
2016-05-20 00:01:21 +02:00
|
|
|
echo "Delete systemd script"
|
2017-03-19 19:16:10 +01:00
|
|
|
sudo systemctl stop $app
|
|
|
|
sudo systemctl disable $app.service
|
|
|
|
sudo rm "/etc/systemd/system/$app.service"
|
2016-05-20 00:01:21 +02:00
|
|
|
fi
|
|
|
|
|
2017-03-19 19:16:10 +01:00
|
|
|
#=================================================
|
|
|
|
# DISABLE SERVICE IN ADMIN PANEL
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
if sudo yunohost service status | grep -q $app # Test l'existence du service dans Yunohost
|
2016-05-20 00:01:21 +02:00
|
|
|
then
|
2017-03-19 19:16:10 +01:00
|
|
|
echo "Remove $app service"
|
|
|
|
sudo yunohost service remove $app
|
2016-03-31 22:41:54 +02:00
|
|
|
fi
|
2015-03-26 13:07:01 +01:00
|
|
|
|
2017-03-19 19:16:10 +01:00
|
|
|
#=================================================
|
|
|
|
# REMOVE DEPENDENCIES
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_remove_app_dependencies
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE THE MAIN DIR OF THE APP
|
|
|
|
#=================================================
|
|
|
|
|
2016-11-08 13:08:16 +01:00
|
|
|
SECURE_REMOVE '/var/www/$app' # Suppression du dossier de l'application
|
2015-11-18 00:28:42 +01:00
|
|
|
|
2017-03-19 19:16:10 +01:00
|
|
|
#=================================================
|
|
|
|
# REMOVE THE NGINX CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
|
2016-06-15 23:56:45 +02:00
|
|
|
REMOVE_NGINX_CONF # Suppression de la configuration nginx
|
2015-11-18 00:28:42 +01:00
|
|
|
|
2017-03-19 19:16:10 +01:00
|
|
|
#=================================================
|
|
|
|
# REMOVE THE LOGROTATE CONFIG
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_remove_logrotate # Suppression de la configuration de logrotate
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SPECIFIC REMOVE
|
|
|
|
#=================================================
|
|
|
|
# REMOVE CRON JOBS
|
|
|
|
#=================================================
|
|
|
|
|
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
|