1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/forgejo_ynh.git synced 2024-09-03 18:36:26 +02:00
forgejo_ynh/scripts/remove

50 lines
1.6 KiB
Text
Raw Normal View History

2023-01-05 14:48:22 +01:00
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
2023-01-05 14:48:22 +01:00
source /usr/share/yunohost/helpers
#=================================================
# STANDARD REMOVE
#=================================================
# REMOVE SERVICE INTEGRATION IN YUNOHOST
#=================================================
2023-01-05 14:48:22 +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
then
ynh_script_progression --message="Removing $app service integration..." --weight=1
2024-05-04 01:24:34 +02:00
yunohost service remove "$app"
fi
2023-01-05 14:48:22 +01:00
# Remove the dedicated systemd config
2023-05-27 17:52:29 +02:00
ynh_script_progression --message="Removing systemd configuration..." --weight=1
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
# Remove the dedicated NGINX config
2023-05-27 17:52:29 +02:00
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1
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
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