2017-04-08 00:06:50 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-05-04 11:47:06 +02:00
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
2017-07-23 00:14:35 +02:00
|
|
|
|
2017-07-23 17:46:25 +02:00
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2018-05-04 11:47:06 +02:00
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
|
|
|
|
2017-04-08 00:06:50 +02:00
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
|
|
|
|
# Retrieve app settings
|
|
|
|
domain=$(ynh_app_setting_get $app domain)
|
|
|
|
|
2018-05-04 11:47:06 +02:00
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
|
|
|
# STOP AND REMOVE SERVICE
|
|
|
|
#=================================================
|
|
|
|
|
2017-07-23 17:46:25 +02:00
|
|
|
ynh_remove_systemd_config
|
2017-04-08 00:06:50 +02:00
|
|
|
|
2018-05-04 11:47:06 +02:00
|
|
|
#=================================================
|
|
|
|
# DISABLE SERVICE IN ADMIN PANEL
|
|
|
|
#=================================================
|
2017-07-30 21:33:54 +02:00
|
|
|
|
2018-05-04 11:47:06 +02:00
|
|
|
if yunohost service status | grep -q $app # Check if service is declared in YunoHost
|
|
|
|
then
|
|
|
|
ynh_print_info "Remove $app service" >&2
|
|
|
|
yunohost service remove $app
|
|
|
|
fi
|
2017-04-08 00:06:50 +02:00
|
|
|
|
2018-05-04 11:47:06 +02:00
|
|
|
#=================================================
|
|
|
|
# REMOVE NODEJS
|
|
|
|
#=================================================
|
2017-04-08 00:06:50 +02:00
|
|
|
|
2018-05-04 11:47:06 +02:00
|
|
|
ynh_remove_nodejs
|
2017-04-08 00:06:50 +02:00
|
|
|
|
2018-05-04 11:47:06 +02:00
|
|
|
#=================================================
|
|
|
|
# REMOVE THE MAIN DIR OF THE APP
|
|
|
|
#=================================================
|
2017-04-08 00:06:50 +02:00
|
|
|
|
2018-05-04 11:47:06 +02:00
|
|
|
ynh_secure_remove "/var/www/$app" # Remove the app directory securely
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE THE NGINX CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_remove_nginx_config # Remove the dedicated nginx config
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE THE LOGROTATE CONFIG
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_remove_logrotate # Remove the app-specific logrotate config
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALIZATION
|
|
|
|
#=================================================
|
|
|
|
# REMOVE DEDICATED USER
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_system_user_delete $app
|