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
|
2019-01-05 20:42:54 +01:00
|
|
|
port=$(ynh_app_setting_get $app port)
|
2017-04-08 00:06:50 +02:00
|
|
|
# Retrieve app settings
|
|
|
|
domain=$(ynh_app_setting_get $app domain)
|
2019-01-05 20:42:54 +01:00
|
|
|
final_path=$(ynh_app_setting_get $app final_path)
|
2017-04-08 00:06:50 +02:00
|
|
|
|
2018-05-04 11:47:06 +02:00
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
|
|
|
# STOP AND REMOVE SERVICE
|
|
|
|
#=================================================
|
|
|
|
|
2019-01-05 20:42:54 +01:00
|
|
|
# Remove the dedicated systemd config
|
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
|
|
|
#=================================================
|
2019-01-05 20:42:54 +01:00
|
|
|
# REMOVE SERVICE FROM ADMIN PANEL
|
2018-05-04 11:47:06 +02:00
|
|
|
#=================================================
|
2017-07-30 21:33:54 +02:00
|
|
|
|
2019-01-05 20:42:54 +01:00
|
|
|
# Remove a service from the admin panel, added by `yunohost service add`
|
|
|
|
if yunohost service status | grep -q $app
|
2018-05-04 11:47:06 +02:00
|
|
|
then
|
2019-01-05 20:42:54 +01:00
|
|
|
echo "Remove $app service"
|
2018-05-04 11:47:06 +02:00
|
|
|
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
|
|
|
#=================================================
|
2019-01-05 20:42:54 +01:00
|
|
|
# REMOVE APP MAIN DIR
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
# Remove the app directory securely
|
|
|
|
ynh_secure_remove "$final_path"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE NGINX CONFIGURATION
|
2018-05-04 11:47:06 +02:00
|
|
|
#=================================================
|
2017-04-08 00:06:50 +02:00
|
|
|
|
2019-01-05 20:42:54 +01:00
|
|
|
# Remove the dedicated nginx config
|
|
|
|
ynh_remove_nginx_config
|
2018-05-04 11:47:06 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# 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
|