2014-10-20 12:55:53 -04:00
|
|
|
#!/bin/bash
|
2016-04-26 09:30:49 -04:00
|
|
|
|
2017-06-02 12:34:13 -04:00
|
|
|
#=================================================
|
2017-06-17 11:54:26 -04:00
|
|
|
# GENERIC START
|
2017-06-02 12:34:13 -04:00
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
2014-10-20 12:55:53 -04:00
|
|
|
|
2017-06-05 07:11:07 -04:00
|
|
|
source _common.sh
|
2016-06-14 08:11:00 -04:00
|
|
|
source /usr/share/yunohost/helpers
|
2016-05-18 16:31:45 -04:00
|
|
|
|
2023-01-30 13:10:14 -05:00
|
|
|
# Settings are automatically loaded as bash variables
|
|
|
|
# in every app script context, therefore typically these will exist:
|
|
|
|
# - $domain
|
|
|
|
# - $path
|
|
|
|
# - $language
|
|
|
|
# - $install_dir
|
|
|
|
# - $port
|
|
|
|
# ...
|
2017-06-02 12:34:13 -04:00
|
|
|
|
2023-01-30 13:10:14 -05:00
|
|
|
# For remove operations :
|
|
|
|
# - the core will deprovision every resource defined in the manifest **after** this script is ran
|
|
|
|
# this includes removing the install directory, and data directory (if --purge was used)
|
2017-06-02 12:34:13 -04:00
|
|
|
|
|
|
|
#=================================================
|
2023-01-30 13:10:14 -05:00
|
|
|
# REMOVE SYSTEM CONFIGURATIONS
|
2017-06-02 12:34:13 -04:00
|
|
|
#=================================================
|
2023-01-30 13:10:14 -05:00
|
|
|
# REMOVE SYSTEMD SERVICE
|
2017-06-02 12:34:13 -04:00
|
|
|
#=================================================
|
2023-01-30 13:10:14 -05:00
|
|
|
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
|
|
|
|
|
|
|
|
# This should be a symetric version of what happens in the install script
|
|
|
|
|
2020-12-04 06:03:07 -05:00
|
|
|
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
|
2019-05-22 14:40:53 -04:00
|
|
|
if ynh_exec_warn_less yunohost service status $app >/dev/null
|
2017-06-02 12:34:13 -04:00
|
|
|
then
|
2022-03-03 17:39:04 -05:00
|
|
|
ynh_script_progression --message="Removing $app service integration..." --weight=1
|
2017-07-05 12:10:43 -04:00
|
|
|
yunohost service remove $app
|
2017-06-02 12:34:13 -04:00
|
|
|
fi
|
|
|
|
|
2019-01-23 19:52:51 -05:00
|
|
|
ynh_remove_systemd_config
|
|
|
|
|
2017-06-02 12:34:13 -04:00
|
|
|
ynh_remove_nginx_config
|
|
|
|
|
|
|
|
ynh_remove_fpm_config
|
|
|
|
|
2023-01-30 13:10:14 -05:00
|
|
|
ynh_remove_logrotate
|
2019-04-18 13:58:47 -04:00
|
|
|
|
|
|
|
ynh_remove_fail2ban_config
|
|
|
|
|
2023-01-30 13:10:14 -05:00
|
|
|
# Remove other various files specific to the app... such as :
|
2014-10-20 12:55:53 -04:00
|
|
|
|
2019-04-15 18:32:39 -04:00
|
|
|
ynh_secure_remove --file="/etc/cron.d/$app"
|
2014-10-20 12:55:53 -04:00
|
|
|
|
2021-04-04 21:10:53 -04:00
|
|
|
ynh_secure_remove --file="/etc/$app"
|
2014-10-20 12:55:53 -04:00
|
|
|
|
2021-04-04 21:10:53 -04:00
|
|
|
ynh_secure_remove --file="/var/log/$app"
|
2015-10-27 11:03:21 -04:00
|
|
|
|
2019-02-10 09:02:38 -05:00
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2022-03-03 17:39:04 -05:00
|
|
|
ynh_script_progression --message="Removal of $app completed" --last
|