2020-10-05 23:05:58 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
|
|
|
# REMOVE SERVICE INTEGRATION IN YUNOHOST
|
|
|
|
#=================================================
|
|
|
|
|
2023-05-26 23:23:50 +02:00
|
|
|
if [ "$mqtt_domain" != "$domain" ]; then
|
2023-02-27 23:24:05 +01:00
|
|
|
ynh_script_progression --message="Removing system configurations related to Mosquitto..." --weight=1
|
|
|
|
yunohost service remove mosquitto
|
|
|
|
ynh_secure_remove --file="/etc/mosquitto/conf.d"
|
|
|
|
ynh_secure_remove --file="/usr/share/yunohost/hooks/conf_regen/95-nginx_domoticz"
|
|
|
|
ynh_secure_remove --file="/etc/nginx/conf.d/"$mqtt_domain".d/mqtt_"$app".conf"
|
|
|
|
yunohost tools regen-conf postfix
|
|
|
|
ynh_secure_remove --file="/var/log/mosquitto"
|
|
|
|
#not required as handled by the core?
|
|
|
|
#ynh_remove_app_dependencies
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
|
2022-05-26 09:30:42 +02:00
|
|
|
if ynh_exec_warn_less yunohost service status "$app" >/dev/null
|
2020-10-05 23:05:58 +02:00
|
|
|
then
|
2021-08-05 02:21:46 +02:00
|
|
|
ynh_script_progression --message="Removing $app service integration..."
|
2022-05-26 09:30:42 +02:00
|
|
|
yunohost service remove "$app"
|
2020-10-05 23:05:58 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Remove the dedicated systemd config
|
|
|
|
ynh_remove_systemd_config
|
|
|
|
|
2022-12-13 22:55:38 +01:00
|
|
|
ynh_secure_remove --file="/etc/nginx/conf.d/"$domain".d/api_"$app".conf"
|
2020-10-05 23:05:58 +02:00
|
|
|
ynh_remove_nginx_config
|
|
|
|
|
|
|
|
ynh_remove_logrotate
|
|
|
|
|
2022-11-28 23:09:34 +01:00
|
|
|
ynh_remove_fail2ban_config
|
|
|
|
|
2021-08-05 02:21:46 +02:00
|
|
|
ynh_secure_remove --file="/var/log/$app"
|
2020-10-05 23:05:58 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2023-02-20 22:22:42 +01:00
|
|
|
ynh_script_progression --message="Removal of $app completed" --last
|