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

85 lines
2.7 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_script_progression --message="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
domain=$(ynh_app_setting_get --app=$app --key=domain)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
2018-06-25 05:57:41 +02:00
2018-09-27 22:44:34 +02:00
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_script_progression --message="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_script_progression --message="Removing app main directory..."
2018-06-25 05:57:41 +02:00
# Remove the app directory securely
ynh_secure_remove --file="$final_path"
2018-06-25 05:57:41 +02:00
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="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_script_progression --message="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_script_progression --message="Removing logrotate configuration..."
2018-09-27 22:44:34 +02:00
# Remove the app-specific logrotate config
ynh_remove_logrotate
2018-09-27 22:44:34 +02:00
#=================================================
# REMOVE FAIL2BAN CONFIGURATION
#=================================================
ynh_script_progression --message="Removing fail2ban configuration..."
# Remove the dedicated fail2ban config
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_script_progression --message="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 --username=$app
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Removal of $app completed"