2018-08-26 19:04:08 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
|
|
|
|
domain=$(ynh_app_setting_get $app domain)
|
2018-10-14 17:45:28 +02:00
|
|
|
port=$(ynh_app_setting_get $app port)
|
2018-08-26 19:04:08 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
|
|
|
# STOP AND REMOVE SERVICE
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_remove_systemd_config
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# DISABLE SERVICE IN ADMIN PANEL
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
if yunohost service status | grep -q $app # Test l'existence du service dans Yunohost
|
|
|
|
then
|
|
|
|
ynh_print_info "Remove $app service" >&2
|
2018-08-28 12:47:16 +02:00
|
|
|
yunohost service remove $app.service
|
2018-08-26 19:04:08 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE DEPENDENCIES
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_remove_app_dependencies
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE THE MAIN DIR OF THE APP
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_secure_remove "/var/www/$app" # Suppression du dossier de l'application
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE THE NGINX CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_remove_nginx_config # Suppression de la configuration nginx
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# CLOSE A PORT
|
|
|
|
#=================================================
|
|
|
|
|
2018-10-14 17:45:28 +02:00
|
|
|
if yunohost firewall list | grep -q "\- $port$"
|
2018-08-26 19:04:08 +02:00
|
|
|
then
|
2018-10-14 17:45:28 +02:00
|
|
|
ynh_print_info "Close port $port" >&2
|
|
|
|
ynh_exec_quiet yunohost firewall disallow TCP $port
|
2018-08-26 19:04:08 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALISATION
|
|
|
|
#=================================================
|
|
|
|
# REMOVE DEDICATED USER
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_system_user_delete $app
|