2014-10-20 19:55:53 +03:00
|
|
|
#!/bin/bash
|
2016-04-26 16:30:49 +03:00
|
|
|
|
2017-06-02 19:34:13 +03:00
|
|
|
#=================================================
|
2017-06-17 18:54:26 +03:00
|
|
|
# GENERIC START
|
2017-06-02 19:34:13 +03:00
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
2014-10-20 19:55:53 +03:00
|
|
|
|
2017-06-05 14:11:07 +03:00
|
|
|
source _common.sh
|
2016-06-14 15:11:00 +03:00
|
|
|
source /usr/share/yunohost/helpers
|
2016-05-18 23:31:45 +03:00
|
|
|
|
2023-01-30 21:10:14 +03: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 19:34:13 +03:00
|
|
|
|
2023-01-30 21:10:14 +03: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 19:34:13 +03:00
|
|
|
|
|
|
|
#=================================================
|
2023-01-30 21:10:14 +03:00
|
|
|
# REMOVE SYSTEM CONFIGURATIONS
|
2017-06-02 19:34:13 +03:00
|
|
|
#=================================================
|
2023-01-30 21:10:14 +03:00
|
|
|
# REMOVE SYSTEMD SERVICE
|
2017-06-02 19:34:13 +03:00
|
|
|
#=================================================
|
|
|
|
|
2023-01-30 21:10:14 +03: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 14:03:07 +03:00
|
|
|
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
|
2019-05-22 21:40:53 +03:00
|
|
|
if ynh_exec_warn_less yunohost service status $app >/dev/null
|
2017-06-02 19:34:13 +03:00
|
|
|
then
|
2022-03-04 01:39:04 +03:00
|
|
|
ynh_script_progression --message="Removing $app service integration..." --weight=1
|
2017-07-05 19:10:43 +03:00
|
|
|
yunohost service remove $app
|
2017-06-02 19:34:13 +03:00
|
|
|
fi
|
|
|
|
|
2019-01-24 03:52:51 +03:00
|
|
|
ynh_remove_systemd_config
|
|
|
|
|
2017-06-02 19:34:13 +03:00
|
|
|
ynh_remove_nginx_config
|
|
|
|
|
|
|
|
ynh_remove_fpm_config
|
|
|
|
|
2023-01-30 21:10:14 +03:00
|
|
|
ynh_remove_logrotate
|
2019-04-18 20:58:47 +03:00
|
|
|
|
|
|
|
ynh_remove_fail2ban_config
|
|
|
|
|
2023-01-30 21:10:14 +03:00
|
|
|
# Remove other various files specific to the app... such as :
|
2014-10-20 19:55:53 +03:00
|
|
|
|
2019-04-16 01:32:39 +03:00
|
|
|
ynh_secure_remove --file="/etc/cron.d/$app"
|
2014-10-20 19:55:53 +03:00
|
|
|
|
2021-04-05 04:10:53 +03:00
|
|
|
ynh_secure_remove --file="/etc/$app"
|
2014-10-20 19:55:53 +03:00
|
|
|
|
2021-04-05 04:10:53 +03:00
|
|
|
ynh_secure_remove --file="/var/log/$app"
|
2015-10-27 18:03:21 +03:00
|
|
|
|
2019-02-10 17:02:38 +03:00
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2022-03-04 01:39:04 +03:00
|
|
|
ynh_script_progression --message="Removal of $app completed" --last
|