#!/bin/bash # to test the functionnality : # yunohost app remove homeassistant --purge #================================================= # GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= source _common.sh source /usr/share/yunohost/helpers #================================================= # STANDARD REMOVE #================================================= # REMOVE SERVICE INTEGRATION IN YUNOHOST #================================================= if ynh_exec_warn_less yunohost service status $app >/dev/null ; then ynh_script_progression --message="Removing $app service integration..." yunohost service remove $app fi #================================================= # STOP AND REMOVE SERVICE #================================================= ynh_script_progression --message="Stopping and removing the systemd service..." ynh_remove_systemd_config --service=$app #================================================= # REMOVE LOGROTATE CONFIGURATION #================================================= ynh_script_progression --message="Removing logrotate configuration..." ynh_remove_logrotate #================================================= # REMOVE NGINX CONFIGURATION #================================================= ynh_script_progression --message="Removing NGINX web server configuration..." ynh_remove_nginx_config #================================================= # REMOVE FAIL2BAN CONFIGURATION #================================================= ynh_script_progression --message="Removing Fail2Ban configuration..." --weight=1 ynh_remove_fail2ban_config #================================================= # SPECIFIC REMOVE #================================================= # REMOVE VARIOUS FILES #================================================= ynh_script_progression --message="Removing various files..." ynh_secure_remove --file="/etc/sudoers.d/$app" ynh_secure_remove --file="$(dirname "$log_file")" #================================================= # END OF SCRIPT #================================================= ynh_script_progression --message="Removal of $app completed" --last