#!/bin/bash #================================================= # GENERIC STARTING #================================================= # IMPORT GENERIC HELPERS #================================================= source _common.sh source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get $app domain) port=$(ynh_app_setting_get $app port) db_name=$(ynh_app_setting_get $app db_name) export=$(ynh_app_setting_get $app export) #================================================= # STANDARD REMOVE #================================================= # STOP AND REMOVE SERVICE #================================================= # Remove the dedicated systemd config ynh_remove_systemd_config #================================================= # REMOVE SERVICE FROM ADMIN PANEL #================================================= # Check if the service is declared in YunoHost if yunohost service status | grep -q $app then ynh_print_info "Remove $app service" >&2 yunohost service remove $app fi #================================================= # REMOVE DEPENDENCIES #================================================= if [ "$export" != "none" ] then # Remove metapackage and its dependencies ynh_remove_app_dependencies fi #================================================= # REMOVE NODEJS #================================================= ynh_remove_nodejs #================================================= # REMOVE THE MYSQL DATABASE #================================================= # Remove a database if it exists, along with the associated user ynh_mysql_remove_db $db_name $db_name #================================================= # REMOVE APP MAIN DIR #================================================= # Remove the app directory securely ynh_secure_remove "/var/www/$app" #================================================= # REMOVE NGINX CONFIGURATION #================================================= # Remove the dedicated nginx config ynh_remove_nginx_config #================================================= # REMOVE LOGROTATE CONFIGURATION #================================================= # Remove the app-specific logrotate config ynh_remove_logrotate #================================================= # REMOVE FAIL2BAN CONFIGURATION #================================================= # Remove the dedicated fail2ban config ynh_remove_fail2ban_config #================================================= # GENERIC FINALIZATION #================================================= # REMOVE DEDICATED USER #================================================= # Delete dedicated system user ynh_system_user_delete $app