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`)
|
2024-05-04 01:24:34 +02:00
|
|
|
if ynh_exec_warn_less yunohost service status "$app" >/dev/null
|
2023-01-11 10:32:49 +01:00
|
|
|
then
|
|
|
|
ynh_script_progression --message="Removing $app service integration..." --weight=1
|
2024-05-04 01:24:34 +02:00
|
|
|
yunohost service remove "$app"
|
2023-01-11 10:32:49 +01:00
|
|
|
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
|