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
|
|
|
#=================================================
|
|
|
|
# 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
|
|
|
|
2024-01-10 17:52:57 -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
|
|
|
|
### ...
|
|
|
|
|
2024-09-03 07:55:06 -04:00
|
|
|
### For remove operations:
|
2024-01-10 17:52:57 -05:00
|
|
|
### - 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
|
|
|
#=================================================
|
2024-06-20 17:49:43 -04:00
|
|
|
ynh_script_progression "Removing system configurations related to $app..."
|
2023-01-30 13:10:14 -05:00
|
|
|
|
2024-01-10 17:52:57 -05:00
|
|
|
### This should be a symetric version of what happens in the install script
|
2023-01-30 13:10:14 -05:00
|
|
|
|
2024-06-20 17:49:43 -04:00
|
|
|
ynh_config_remove_fail2ban
|
2023-11-05 17:03:21 -05:00
|
|
|
|
2024-06-20 17:49:43 -04:00
|
|
|
ynh_config_remove_logrotate
|
2023-11-05 17:03:21 -05:00
|
|
|
|
2024-06-20 10:08:54 -04:00
|
|
|
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
|
2024-06-20 17:49:43 -04:00
|
|
|
if ynh_hide_warnings yunohost service status "$app" >/dev/null; then
|
2024-06-20 10:08:54 -04:00
|
|
|
yunohost service remove "$app"
|
|
|
|
fi
|
2024-06-20 17:49:43 -04:00
|
|
|
ynh_config_remove_systemd
|
2019-01-23 19:52:51 -05:00
|
|
|
|
2024-06-20 17:49:43 -04:00
|
|
|
ynh_config_remove_nginx
|
2017-06-02 12:34:13 -04:00
|
|
|
|
2024-06-20 17:49:43 -04:00
|
|
|
ynh_config_remove_phpfpm
|
2017-06-02 12:34:13 -04:00
|
|
|
|
2024-09-03 07:55:06 -04:00
|
|
|
# Remove other various files specific to the app... such as:
|
2014-10-20 12:55:53 -04:00
|
|
|
|
2024-06-20 17:49:43 -04:00
|
|
|
ynh_safe_rm "/etc/cron.d/$app"
|
2014-10-20 12:55:53 -04:00
|
|
|
|
2024-06-20 17:49:43 -04:00
|
|
|
ynh_safe_rm "/etc/$app"
|
2014-10-20 12:55:53 -04:00
|
|
|
|
2019-02-10 09:02:38 -05:00
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2024-06-20 17:49:43 -04:00
|
|
|
ynh_script_progression "Removal of $app completed"
|