2015-09-14 17:12:17 +02:00
#!/bin/bash
2016-07-05 15:22:12 +02:00
2022-02-13 22:09:18 +01:00
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
2017-05-18 23:28:18 +02:00
source _common.sh
2022-02-13 22:09:18 +01:00
source /usr/share/yunohost/helpers
#=================================================
2024-03-20 20:49:39 +01:00
# REMOVE SYSTEM CONFIGURATIONS
2022-02-13 22:09:18 +01:00
#=================================================
2024-08-31 01:00:51 +02:00
ynh_script_progression "Removing system configurations related to $app..."
2016-07-05 15:22:12 +02:00
2022-02-13 22:09:18 +01:00
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
2024-08-31 01:00:51 +02:00
if ynh_hide_warnings yunohost service status "$app" >/dev/null; then
2024-03-20 20:49:39 +01:00
yunohost service remove "$app"
2022-02-13 22:09:18 +01:00
fi
2018-12-14 03:36:58 +01:00
2022-02-17 01:23:35 +01:00
# Remove the dedicated systemd config
2024-08-31 01:00:51 +02:00
ynh_config_remove_systemd
2022-02-17 01:23:35 +01:00
2022-02-13 22:09:18 +01:00
# Remove the dedicated NGINX config
2024-08-31 01:00:51 +02:00
ynh_config_remove_nginx
2018-09-27 00:31:17 +02:00
2022-02-13 22:09:18 +01:00
#=================================================
# REMOVE VARIOUS FILES
#=================================================
2024-08-31 01:00:51 +02:00
ynh_script_progression "Removing various files..."
2022-02-13 22:09:18 +01:00
2022-02-17 01:23:35 +01:00
# Remove a directory securely
2024-08-31 01:00:51 +02:00
ynh_safe_rm "/etc/$app"
2022-02-17 01:23:35 +01:00
# Remove the log files
2024-08-31 01:00:51 +02:00
#REMOVEME? (Apps should not remove their log dir during remove ... this should only happen if --purge is used, and be handled by the core...) ynh_safe_rm "/var/log/$app.log"
2022-02-17 01:23:35 +01:00
#=================================================
# REMOVE SWAP
#=================================================
2022-02-13 22:09:18 +01:00
2024-08-31 01:00:51 +02:00
# if ! ynh_in_ci_tests; then
# ynh_script_progression "Removing swap..."
2024-03-20 22:52:21 +01:00
# ynh_del_swap
# fi
2022-02-13 22:09:18 +01:00
#=================================================
# END OF SCRIPT
#=================================================
2024-08-31 01:00:51 +02:00
ynh_script_progression "Removal of $app completed"