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

42 lines
1.2 KiB
Bash
Executable file

#!/bin/bash
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# STANDARD REMOVE
#=================================================
# REMOVE SERVICE INTEGRATION IN YUNOHOST
#=================================================
if [ "$domain" != "$mqtt_domain" ]; then
ynh_script_progression "Removing system configurations related to Mosquitto..."
yunohost service remove mosquitto
ynh_safe_rm "/etc/mosquitto/conf.d"
ynh_safe_rm "/usr/share/yunohost/hooks/conf_regen/95-nginx_domoticz"
ynh_safe_rm "/etc/nginx/conf.d/${mqtt_domain}.d/mqtt_${app}.conf"
yunohost tools regen-conf postfix
fi
ynh_script_progression "Removing system configurations related to $app..."
if ynh_hide_warnings yunohost service status "$app" >/dev/null
then
ynh_script_progression "Removing $app service integration..."
yunohost service remove "$app"
fi
# Remove the dedicated systemd config
ynh_config_remove_systemd
ynh_safe_rm "/etc/nginx/conf.d/${domain}.d/api_${app}.conf"
ynh_config_remove_nginx
ynh_config_remove_logrotate
ynh_config_remove_fail2ban
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression "Removal of $app completed"