my_webapp_ynh/scripts/remove
Éric Gaspar 0f3fc48543 cleaning
2024-06-23 21:51:49 +02:00

47 lines
1.5 KiB
Bash

#!/bin/bash
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# STANDARD REMOVE
#=================================================
# REMOVE THE MYSQL DATABASE
#=================================================
if [ $database != "none" ]; then
ynh_script_progression "Removing the database..."
db_name=$(ynh_app_setting_get --key=db_name)
db_user=$db_name
# Remove a database if it exists, along with the associated user
if [ $database == "mysql" ]; then
# FIXME ynh_mysql_drop_db && ynh_mysql_drop_user --db_user=$db_user --db_name=$db_name
elif [ $database == "postgresql" ]; then
# FIXME ynh_psql_drop_db && ynh_psql_drop_user --db_user=$db_user --db_name=$db_name
fi
fi
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
ynh_script_progression "Removing NGINX web server configuration..."
# Remove the dedicated NGINX config
ynh_config_remove_nginx
ynh_safe_rm "/etc/nginx/conf.d/$domain.d/$app.d"
#=================================================
# REMOVE PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression "Removing PHP-FPM configuration..."
# Remove the dedicated PHP-FPM config
ynh_config_remove_phpfpm
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression "Removal of $app completed"