2013-12-19 03:02:51 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-06-25 05:57:41 +02:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
2020-11-01 16:00:22 +01:00
|
|
|
ynh_script_progression --message="Loading installation settings..."
|
2018-06-25 05:57:41 +02:00
|
|
|
|
2017-02-26 18:10:35 +01:00
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
2013-12-29 19:55:11 +01:00
|
|
|
|
2020-12-01 12:03:07 +01:00
|
|
|
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
2020-11-01 16:00:22 +01:00
|
|
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
2018-06-25 05:57:41 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE APP MAIN DIR
|
|
|
|
#=================================================
|
2020-11-01 16:00:22 +01:00
|
|
|
ynh_script_progression --message="Removing app main directory..."
|
2018-06-25 05:57:41 +02:00
|
|
|
|
|
|
|
# Remove the app directory securely
|
2020-11-01 16:00:22 +01:00
|
|
|
ynh_secure_remove --file="$final_path"
|
2018-06-25 05:57:41 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE NGINX CONFIGURATION
|
|
|
|
#=================================================
|
2020-11-24 18:00:33 +01:00
|
|
|
ynh_script_progression --message="Removing NGINX web server configuration..."
|
2018-06-25 05:57:41 +02:00
|
|
|
|
2020-11-24 18:00:33 +01:00
|
|
|
# Remove the dedicated NGINX config
|
2018-06-25 05:57:41 +02:00
|
|
|
ynh_remove_nginx_config
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE PHP-FPM CONFIGURATION
|
|
|
|
#=================================================
|
2020-11-24 18:00:33 +01:00
|
|
|
ynh_script_progression --message="Removing PHP-FPM configuration..."
|
2018-06-25 05:57:41 +02:00
|
|
|
|
2020-11-24 18:00:33 +01:00
|
|
|
# Remove the dedicated PHP-FPM config
|
2018-06-25 05:57:41 +02:00
|
|
|
ynh_remove_fpm_config
|
2017-02-26 18:10:35 +01:00
|
|
|
|
2018-09-27 22:44:34 +02:00
|
|
|
#=================================================
|
|
|
|
# REMOVE LOGROTATE CONFIGURATION
|
|
|
|
#=================================================
|
2020-11-01 16:00:22 +01:00
|
|
|
ynh_script_progression --message="Removing logrotate configuration..."
|
2021-11-22 19:20:21 +01:00
|
|
|
|
2018-09-27 22:44:34 +02:00
|
|
|
# Remove the app-specific logrotate config
|
|
|
|
ynh_remove_logrotate
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE FAIL2BAN CONFIGURATION
|
|
|
|
#=================================================
|
2020-11-24 18:00:33 +01:00
|
|
|
ynh_script_progression --message="Removing Fail2Ban configuration..."
|
2020-11-01 16:00:22 +01:00
|
|
|
|
|
|
|
# Remove the dedicated fail2ban config
|
2018-09-27 22:44:34 +02:00
|
|
|
ynh_remove_fail2ban_config
|
|
|
|
|
2019-04-05 12:29:32 +02:00
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALIZATION
|
2018-06-25 05:57:41 +02:00
|
|
|
#=================================================
|
|
|
|
# REMOVE DEDICATED USER
|
|
|
|
#=================================================
|
2020-11-01 16:00:22 +01:00
|
|
|
ynh_script_progression --message="Removing the dedicated system user..."
|
2017-02-26 18:10:35 +01:00
|
|
|
|
2018-06-25 05:57:41 +02:00
|
|
|
# Delete a system user
|
2020-11-01 16:00:22 +01:00
|
|
|
ynh_system_user_delete --username=$app
|
2019-04-05 12:29:32 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2020-11-11 14:06:42 +01:00
|
|
|
ynh_script_progression --message="Removal of $app completed"
|