|
|
|
@ -15,11 +15,22 @@ source /usr/share/yunohost/helpers |
|
|
|
ynh_script_progression --message="Loading installation settings..." --weight=2 |
|
|
|
|
|
|
|
app=$YNH_APP_INSTANCE_NAME |
|
|
|
app_dev=$app-dev |
|
|
|
app_staging=$app-staging |
|
|
|
app_initial=$app |
|
|
|
|
|
|
|
domain=$(ynh_app_setting_get --app=$app --key=domain) |
|
|
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name) |
|
|
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path) |
|
|
|
|
|
|
|
domain_dev=$(ynh_app_setting_get --app=$app --key=domain_dev) |
|
|
|
db_name_dev=$(ynh_app_setting_get --app=$app --key=db_name_dev) |
|
|
|
final_path_dev=$(ynh_app_setting_get --app=$app --key=final_path_dev) |
|
|
|
|
|
|
|
domain_staging=$(ynh_app_setting_get --app=$app --key=domain_staging) |
|
|
|
db_name_staging=$(ynh_app_setting_get --app=$app --key=db_name_staging) |
|
|
|
final_path_staging=$(ynh_app_setting_get --app=$app --key=final_path_staging) |
|
|
|
|
|
|
|
#================================================= |
|
|
|
# STANDARD REMOVE |
|
|
|
#================================================= |
|
|
|
@ -30,6 +41,12 @@ ynh_script_progression --message="Removing the MySQL database..." --weight=2 |
|
|
|
# Remove a database if it exists, along with the associated user |
|
|
|
ynh_mysql_remove_db --db_user=$db_name --db_name=$db_name |
|
|
|
|
|
|
|
# Remove a database if it exists, along with the associated user |
|
|
|
ynh_mysql_remove_db --db_user=$db_name_dev --db_name=$db_name_dev |
|
|
|
|
|
|
|
# Remove a database if it exists, along with the associated user |
|
|
|
ynh_mysql_remove_db --db_user=$db_name_staging --db_name=$db_name_staging |
|
|
|
|
|
|
|
#================================================= |
|
|
|
# REMOVE APP MAIN DIR |
|
|
|
#================================================= |
|
|
|
@ -38,6 +55,12 @@ ynh_script_progression --message="Removing app main directory..." |
|
|
|
# Remove the app directory securely |
|
|
|
ynh_secure_remove --file="$final_path" |
|
|
|
|
|
|
|
# Remove the app directory securely |
|
|
|
ynh_secure_remove --file="$final_path_dev" |
|
|
|
|
|
|
|
# Remove the app directory securely |
|
|
|
ynh_secure_remove --file="$final_path_staging" |
|
|
|
|
|
|
|
#================================================= |
|
|
|
# REMOVE NGINX CONFIGURATION |
|
|
|
#================================================= |
|
|
|
@ -46,6 +69,16 @@ ynh_script_progression --message="Removing NGINX web server configuration..." |
|
|
|
# Remove the dedicated NGINX config |
|
|
|
ynh_remove_nginx_config |
|
|
|
|
|
|
|
app=$app_dev |
|
|
|
# Remove the dedicated NGINX config |
|
|
|
ynh_remove_nginx_config |
|
|
|
|
|
|
|
app=$app_staging |
|
|
|
# Remove the dedicated NGINX config |
|
|
|
ynh_remove_nginx_config |
|
|
|
|
|
|
|
app=$app_initial |
|
|
|
|
|
|
|
#================================================= |
|
|
|
# REMOVE PHP-FPM CONFIGURATION |
|
|
|
#================================================= |
|
|
|
@ -54,6 +87,16 @@ ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=2 |
|
|
|
# Remove the dedicated PHP-FPM config |
|
|
|
ynh_remove_fpm_config |
|
|
|
|
|
|
|
app=$app_dev |
|
|
|
# Remove the dedicated PHP-FPM config |
|
|
|
ynh_remove_fpm_config |
|
|
|
|
|
|
|
app=$app_staging |
|
|
|
# Remove the dedicated PHP-FPM config |
|
|
|
ynh_remove_fpm_config |
|
|
|
|
|
|
|
app=$app_initial |
|
|
|
|
|
|
|
#================================================= |
|
|
|
# REMOVE FAIL2BAN CONFIGURATION |
|
|
|
#================================================= |
|
|
|
@ -62,11 +105,23 @@ ynh_script_progression --message="Removing Fail2Ban configuration..." --weight=8 |
|
|
|
# Remove the dedicated Fail2Ban config |
|
|
|
ynh_remove_fail2ban_config |
|
|
|
|
|
|
|
app=$app_dev |
|
|
|
# Remove the dedicated Fail2Ban config |
|
|
|
ynh_remove_fail2ban_config |
|
|
|
|
|
|
|
app=$app_staging |
|
|
|
# Remove the dedicated Fail2Ban config |
|
|
|
ynh_remove_fail2ban_config |
|
|
|
|
|
|
|
app=$app_initial |
|
|
|
|
|
|
|
#================================================= |
|
|
|
# REMOVE THE CRON |
|
|
|
#================================================= |
|
|
|
|
|
|
|
ynh_secure_remove /etc/cron.d/$app |
|
|
|
ynh_secure_remove /etc/cron.d/$app_dev |
|
|
|
ynh_secure_remove /etc/cron.d/$app_staging |
|
|
|
|
|
|
|
#================================================= |
|
|
|
# GENERIC FINALISATION |
|
|
|
@ -78,6 +133,12 @@ ynh_script_progression --message="Removing the dedicated system user..." --weigh |
|
|
|
# Delete dedicated system user |
|
|
|
ynh_system_user_delete --username=$app |
|
|
|
|
|
|
|
# Delete dedicated system user |
|
|
|
ynh_system_user_delete --username=$app_dev |
|
|
|
|
|
|
|
# Delete dedicated system user |
|
|
|
ynh_system_user_delete --username=$app_staging |
|
|
|
|
|
|
|
#================================================= |
|
|
|
# END OF SCRIPT |
|
|
|
#================================================= |
|
|
|
|