1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/shaarli_ynh.git synced 2024-09-03 20:26:10 +02:00
shaarli_ynh/scripts/remove

84 lines
2.4 KiB
Text
Raw Normal View History

2013-12-19 03:02:51 +01:00
#!/bin/bash
2018-06-25 05:57:41 +02:00
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
ynh_print_info "Loading installation settings..."
2018-06-25 05:57:41 +02:00
2017-02-26 18:10:35 +01:00
app=$YNH_APP_INSTANCE_NAME
2013-12-29 19:55:11 +01:00
2018-06-25 05:57:41 +02:00
domain=$(ynh_app_setting_get $app domain)
final_path=$(ynh_app_setting_get $app final_path)
2018-09-27 22:44:34 +02:00
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_print_info "Removing dependencies"
2018-09-27 22:44:34 +02:00
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
2018-06-25 05:57:41 +02:00
#=================================================
# REMOVE APP MAIN DIR
#=================================================
ynh_print_info "Removing app main directory"
2018-06-25 05:57:41 +02:00
# Remove the app directory securely
ynh_secure_remove "$final_path"
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
ynh_print_info "Removing nginx web server configuration"
2018-06-25 05:57:41 +02:00
# Remove the dedicated nginx config
ynh_remove_nginx_config
#=================================================
# REMOVE PHP-FPM CONFIGURATION
#=================================================
ynh_print_info "Removing php-fpm configuration"
2018-06-25 05:57:41 +02:00
# Remove the dedicated php-fpm config
ynh_remove_fpm_config
2017-02-26 18:10:35 +01:00
2018-09-27 22:44:34 +02:00
#=================================================
# REMOVE LOGROTATE CONFIGURATION
#=================================================
ynh_print_info "Removing logrotate configuration"
2018-09-27 22:44:34 +02:00
# Remove the app-specific logrotate config
ynh_remove_logrotate
#=================================================
# REMOVE FAIL2BAN CONFIGURATION
#=================================================
ynh_print_info "Removing Fail2Ban configuration"
2018-09-27 22:44:34 +02:00
ynh_remove_fail2ban_config
#=================================================
# GENERIC FINALIZATION
2018-06-25 05:57:41 +02:00
#=================================================
# REMOVE DEDICATED USER
#=================================================
ynh_print_info "Removing the dedicated system user"
2017-02-26 18:10:35 +01:00
2018-06-25 05:57:41 +02:00
# Delete a system user
ynh_system_user_delete $app
#=================================================
# END OF SCRIPT
#=================================================
ynh_print_info "Removal of $app completed"