chibisafe_ynh/scripts/remove

55 lines
1.5 KiB
Text
Raw Normal View History

2014-10-20 12:55:53 -04:00
#!/bin/bash
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
source /usr/share/yunohost/helpers
### 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:
### - 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
#=================================================
# 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..."
### This should be a symetric version of what happens in the install script
2024-06-20 17:49:43 -04:00
ynh_config_remove_fail2ban
2024-06-20 17:49:43 -04:00
ynh_config_remove_logrotate
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
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"