2014-05-10 11:54:15 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-05-01 15:47:20 +02:00
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
2014-05-10 11:54:15 +02:00
|
|
|
|
2017-08-28 03:03:36 +02:00
|
|
|
# source _common.sh
|
2017-05-01 15:47:20 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
2016-07-04 21:16:34 +02:00
|
|
|
|
2017-05-01 15:47:20 +02:00
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
2016-07-04 21:16:34 +02:00
|
|
|
|
2017-05-01 15:47:20 +02:00
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
2016-07-04 21:16:34 +02:00
|
|
|
|
2017-05-01 15:47:20 +02:00
|
|
|
domain=$(ynh_app_setting_get $app domain)
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
|
|
|
# STOP AND REMOVE SERVICE
|
|
|
|
#=================================================
|
|
|
|
|
2017-08-28 03:03:36 +02:00
|
|
|
# Remove the uwsgi configuration
|
|
|
|
systemctl stop uwsgi
|
2017-05-01 15:47:20 +02:00
|
|
|
if [ -h "/etc/uwsgi/apps-enabled/$app.ini" ]; then
|
|
|
|
echo "Delete uwsgi config"
|
|
|
|
ynh_secure_remove "/etc/uwsgi/apps-enabled/$app.ini"
|
|
|
|
fi
|
|
|
|
ynh_secure_remove "/etc/uwsgi/apps-available/$app.ini"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE DEPENDENCIES
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_remove_app_dependencies
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE THE MAIN DIR OF THE APP
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_secure_remove "/opt/yunohost/$app"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE THE NGINX CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
|
2017-08-28 03:03:36 +02:00
|
|
|
# Remove the dedicated nginx config
|
|
|
|
ynh_remove_nginx_config
|
2017-05-01 15:47:20 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# DISABLE SERVICE IN ADMIN PANEL
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
if [ -e /etc/init.d/uwsgi ]
|
|
|
|
then
|
|
|
|
# Redémarre le service uwsgi si il n'est pas désinstallé.
|
2017-08-28 03:03:36 +02:00
|
|
|
systemctl start uwsgi
|
2017-05-01 15:47:20 +02:00
|
|
|
else
|
2017-08-28 03:03:36 +02:00
|
|
|
if yunohost service status | grep -q uwsgi # Test l'existence du service dans Yunohost
|
2017-05-01 15:47:20 +02:00
|
|
|
then
|
|
|
|
echo "Remove uwsgi service"
|
2017-08-28 03:03:36 +02:00
|
|
|
yunohost service remove uwsgi
|
2017-05-01 15:47:20 +02:00
|
|
|
fi
|
2016-07-05 12:25:33 +02:00
|
|
|
fi
|
2016-07-05 12:49:44 +02:00
|
|
|
|
2017-05-01 15:47:20 +02:00
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALISATION
|
|
|
|
#=================================================
|
|
|
|
# REMOVE DEDICATED USER
|
|
|
|
#=================================================
|
2016-07-05 12:49:44 +02:00
|
|
|
|
2017-08-28 03:03:36 +02:00
|
|
|
# Delete a system user
|
2017-05-01 15:47:20 +02:00
|
|
|
ynh_system_user_delete $app
|