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