1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/freshrss_ynh.git synced 2024-09-03 18:36:33 +02:00
freshrss_ynh/scripts/remove

92 lines
2.6 KiB
Text
Raw Normal View History

2014-07-23 15:52:50 +02:00
#!/bin/bash
2019-02-21 08:05:43 +01:00
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
2017-02-13 23:55:58 +01:00
2018-10-21 17:55:39 +02:00
#=================================================
2019-02-21 08:05:43 +01:00
# LOAD SETTINGS
2018-10-21 17:55:39 +02:00
#=================================================
2019-02-21 08:05:43 +01:00
ynh_print_info "Loading installation settings..."
2018-10-21 17:55:39 +02:00
2017-03-05 18:02:17 +01:00
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain)
2019-02-21 08:05:43 +01:00
db_name=$(ynh_app_setting_get $app db_name)
db_user=$db_name
final_path=$(ynh_app_setting_get $app final_path)
#=================================================
# STANDARD REMOVE
#=================================================
#=================================================
# REMOVE THE MYSQL DATABASE
#=================================================
ynh_print_info "Removing the MySQL database"
# Remove a database if it exists, along with the associated user
ynh_mysql_remove_db $db_user $db_name
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_print_info "Removing dependencies"
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
#=================================================
# REMOVE APP MAIN DIR
#=================================================
ynh_print_info "Removing app main directory"
# Remove the app directory securely
ynh_secure_remove "$final_path"
2017-02-13 23:55:58 +01:00
2019-02-21 08:05:43 +01:00
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
ynh_print_info "Removing nginx web server configuration"
# Remove the dedicated nginx config
ynh_remove_nginx_config
#=================================================
# REMOVE PHP-FPM CONFIGURATION
#=================================================
ynh_print_info "Removing php-fpm configuration"
# Remove the dedicated php-fpm config
ynh_remove_fpm_config
2014-07-23 15:52:50 +02:00
2019-02-21 08:05:43 +01:00
#=================================================
# SPECIFIC REMOVE
#=================================================
# REMOVE THE CRON FILE
#=================================================
# Remove a cron file
ynh_secure_remove "/etc/cron.d/$app"
#=================================================
# GENERIC FINALIZATION
#=================================================
# REMOVE DEDICATED USER
#=================================================
ynh_print_info "Removing the dedicated system user"
# Delete a system user
ynh_system_user_delete $app
#=================================================
# END OF SCRIPT
#=================================================
2014-07-23 15:52:50 +02:00
2019-02-21 08:05:43 +01:00
ynh_print_info "Removal of $app completed"