chibisafe_ynh/scripts/remove

65 lines
1.8 KiB
Text
Raw Normal View History

2014-10-20 12:55:53 -04:00
#!/bin/bash
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
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
# ...
2017-06-02 12:34:13 -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
#=================================================
# REMOVE SYSTEMD SERVICE
2017-06-02 12:34:13 -04: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
ynh_script_progression --message="Removing $app service integration..." --weight=1
yunohost service remove $app
2017-06-02 12:34:13 -04:00
fi
ynh_remove_systemd_config
2017-06-02 12:34:13 -04:00
ynh_remove_nginx_config
ynh_remove_fpm_config
ynh_remove_logrotate
2019-04-18 13:58:47 -04:00
ynh_remove_fail2ban_config
# 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
ynh_secure_remove --file="/etc/$app"
2014-10-20 12:55:53 -04:00
ynh_secure_remove --file="/var/log/$app"
2019-02-10 09:02:38 -05:00
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Removal of $app completed" --last