diff --git a/scripts/remove b/scripts/remove index d53be6d..79b9812 100755 --- a/scripts/remove +++ b/scripts/remove @@ -18,9 +18,9 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) port=$(ynh_app_setting_get --app=$app --key=port) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name +console_port=$(ynh_app_setting_get --app=$app --key=console_port) final_path=$(ynh_app_setting_get --app=$app --key=final_path) +datadir==$(ynh_app_setting_get --app=$app --key=datadir) #================================================= # STANDARD REMOVE @@ -51,14 +51,6 @@ ynh_script_progression --message="Removing logrotate configuration..." --time -- # Remove the app-specific logrotate config ynh_remove_logrotate -#================================================= -# REMOVE THE MYSQL DATABASE -#================================================= -ynh_script_progression --message="Removing the MySQL database..." --time --weight=1 - -# Remove a database if it exists, along with the associated user -ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name - #================================================= # REMOVE DEPENDENCIES #================================================= @@ -74,6 +66,7 @@ ynh_script_progression --message="Removing app main directory..." --time --weigh # Remove the app directory securely ynh_secure_remove --file="$final_path" +ynh_secure_remove --file="$datadir" #================================================= # REMOVE NGINX CONFIGURATION @@ -101,6 +94,12 @@ then ynh_exec_warn_less yunohost firewall disallow TCP $port fi +if yunohost firewall list | grep -q "\- $console_port$" +then + ynh_script_progression --message="Closing port $console_port..." --time --weight=1 + ynh_exec_warn_less yunohost firewall disallow TCP $port +fi + #================================================= # REMOVE FAIL2BAN CONFIGURATION #=================================================