libreerp_ynh/scripts/remove

51 lines
1.5 KiB
Text
Raw Normal View History

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-03-20 20:49:39 +01:00
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
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-03-20 20:49:39 +01:00
if ynh_exec_warn_less yunohost service status "$app" >/dev/null; then
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
ynh_remove_systemd_config
2022-02-13 22:09:18 +01:00
# Remove the dedicated NGINX config
2018-12-14 03:36:58 +01:00
ynh_remove_nginx_config
2018-09-27 00:31:17 +02:00
2022-02-13 22:09:18 +01:00
#=================================================
# REMOVE VARIOUS FILES
#=================================================
2022-10-20 02:27:52 +02:00
ynh_script_progression --message="Removing various files..." --weight=1
2022-02-13 22:09:18 +01:00
2022-02-17 01:23:35 +01:00
# Remove a directory securely
ynh_secure_remove --file="/etc/$app"
# Remove the log files
ynh_secure_remove --file="/var/log/$app.log"
#=================================================
# REMOVE SWAP
#=================================================
2022-02-13 22:09:18 +01:00
2024-03-20 22:52:21 +01:00
# if [ "${PACKAGE_CHECK_EXEC:-0}" -ne 1 ]; then
# ynh_script_progression --message="Removing swap..." --weight=1
# ynh_del_swap
# fi
2022-02-13 22:09:18 +01:00
#=================================================
# END OF SCRIPT
#=================================================
2022-10-20 02:27:52 +02:00
ynh_script_progression --message="Removal of $app completed" --last