1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/my_capsule_ynh.git synced 2024-09-03 19:46:21 +02:00
my_capsule_ynh/scripts/remove

66 lines
2 KiB
Text
Raw Normal View History

2021-07-10 17:59:22 +02:00
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
2022-07-29 20:46:20 +02:00
source ynh_apps
2021-07-10 17:59:22 +02:00
source /usr/share/yunohost/helpers
#=================================================
# STANDARD REMOVE
#=================================================
# REMOVE THE MYSQL DATABASE
#=================================================
2021-07-14 16:10:15 +02:00
if [ $with_mysql -eq 1 ]; then
2023-06-14 18:12:24 +02:00
ynh_script_progression --message="Removing the MySQL database..."
2021-07-14 16:10:15 +02:00
# Remove a database if it exists, along with the associated user
2023-06-14 18:12:24 +02:00
ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name
2021-07-14 16:10:15 +02:00
fi
2021-07-10 17:59:22 +02:00
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
2021-07-14 16:10:15 +02:00
ynh_script_progression --message="Removing NGINX web server configuration..."
2021-07-10 17:59:22 +02:00
# Remove the dedicated NGINX config
ynh_remove_nginx_config
#=================================================
# REMOVE PHP-FPM CONFIGURATION
#=================================================
2021-07-14 16:10:15 +02:00
ynh_script_progression --message="Removing PHP-FPM configuration..."
2021-07-10 17:59:22 +02:00
# Remove the dedicated PHP-FPM config
ynh_remove_fpm_config
2022-07-30 01:12:23 +02:00
#=================================================
# REMOVE VARIOUS FILES
#=================================================
ynh_script_progression --message="Removing various files..."
# Remove a directory securely
ynh_secure_remove --file="/etc/gemserv/config.d/$domain.toml"
ynh_systemd_action --service_name=gemserv --action=reload
2022-07-29 20:46:20 +02:00
#=================================================
# REMOVE DEPENDENCIES
#=================================================
2023-06-14 18:12:24 +02:00
ynh_script_progression --message="Removing dependencies..."
2022-07-29 20:46:20 +02:00
# Remove metapackage and its dependencies
2024-01-28 13:42:18 +01:00
# ynh_remove_apps
yunohost app remove gemserv
2022-07-29 20:46:20 +02:00
2021-07-10 17:59:22 +02:00
#=================================================
# END OF SCRIPT
#=================================================
2021-07-14 16:10:15 +02:00
ynh_script_progression --message="Removal of $app completed"