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

68 lines
2.2 KiB
Text
Raw Normal View History

2022-01-08 10:04:57 +01:00
#!/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
#=================================================
2023-02-12 22:01:31 +01:00
ynh_script_progression --message="Stopping and removing the systemd service..."
2022-01-08 10:04:57 +01:00
ynh_remove_systemd_config --service=$app
#=================================================
# REMOVE LOGROTATE CONFIGURATION
#=================================================
2023-02-12 22:01:31 +01:00
ynh_script_progression --message="Removing logrotate configuration..."
2022-01-08 10:04:57 +01:00
ynh_remove_logrotate
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
2023-02-12 22:01:31 +01:00
ynh_script_progression --message="Removing NGINX web server configuration..."
2022-01-08 10:04:57 +01:00
ynh_remove_nginx_config
2023-01-31 11:14:50 +01:00
#=================================================
# REMOVE FAIL2BAN CONFIGURATION
#=================================================
2023-02-12 22:01:31 +01:00
ynh_script_progression --message="Removing Fail2Ban configuration..." --weight=1
2023-01-31 11:14:50 +01:00
ynh_remove_fail2ban_config
2022-01-08 10:04:57 +01:00
#=================================================
# SPECIFIC REMOVE
#=================================================
# REMOVE VARIOUS FILES
#=================================================
2023-02-12 22:01:31 +01:00
ynh_script_progression --message="Removing various files..."
2022-01-08 10:04:57 +01:00
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