2023-01-05 14:48:22 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
2023-01-11 10:32:49 +01:00
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
2023-01-05 14:48:22 +01:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
2023-01-11 10:32:49 +01:00
|
|
|
# REMOVE SERVICE INTEGRATION IN YUNOHOST
|
|
|
|
#=================================================
|
2023-01-05 14:48:22 +01:00
|
|
|
|
2023-01-11 10:32:49 +01:00
|
|
|
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
|
|
|
|
if ynh_exec_warn_less yunohost service status $app >/dev/null
|
|
|
|
then
|
|
|
|
ynh_script_progression --message="Removing $app service integration..." --weight=1
|
|
|
|
yunohost service remove $app
|
|
|
|
fi
|
2023-01-05 14:48:22 +01:00
|
|
|
|
2023-01-11 10:32:49 +01:00
|
|
|
# Remove the dedicated systemd config
|
2023-05-27 17:52:29 +02:00
|
|
|
ynh_script_progression --message="Removing systemd configuration..." --weight=1
|
2023-01-11 10:32:49 +01:00
|
|
|
ynh_remove_systemd_config
|
|
|
|
|
2023-01-05 14:48:22 +01:00
|
|
|
# Remove the app-specific logrotate config
|
2023-05-27 17:52:29 +02:00
|
|
|
ynh_script_progression --message="Removing logrotate configuration..." --weight=1
|
2023-01-05 14:48:22 +01:00
|
|
|
ynh_remove_logrotate
|
|
|
|
|
2023-01-11 10:32:49 +01:00
|
|
|
# Remove the dedicated NGINX config
|
2023-05-27 17:52:29 +02:00
|
|
|
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1
|
2023-01-11 10:32:49 +01:00
|
|
|
ynh_remove_nginx_config
|
|
|
|
|
|
|
|
# Remove the dedicated Fail2Ban config
|
2023-05-27 17:52:29 +02:00
|
|
|
ynh_script_progression --message="Removing Fail2Ban configuration..." --weight=1
|
2023-01-05 14:48:22 +01:00
|
|
|
ynh_remove_fail2ban_config
|
|
|
|
|
2023-05-27 17:52:29 +02:00
|
|
|
# Remove logs
|
|
|
|
ynh_script_progression --message="Removing logs..." --weight=2
|
2023-01-11 10:32:49 +01:00
|
|
|
ynh_secure_remove --file="/var/log/$app"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
2023-01-05 14:48:22 +01:00
|
|
|
|
|
|
|
ynh_script_progression --message="Removal of $app completed" --last
|