qr_ynh/scripts/remove

63 lines
2.0 KiB
Plaintext
Raw Normal View History

2019-08-12 23:55:33 +02:00
#!/bin/bash
#=================================================
2019-08-13 21:35:51 +02:00
# GENERIC START
2019-08-12 23:55:33 +02:00
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
2020-10-25 16:31:23 +01:00
ynh_script_progression --message="Loading installation settings..."
2019-08-12 23:55:33 +02:00
app=$YNH_APP_INSTANCE_NAME
2019-08-13 21:35:51 +02:00
domain=$(ynh_app_setting_get --app=$app --key=domain)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# STANDARD REMOVE
2019-08-12 23:55:33 +02:00
#=================================================
2019-08-13 21:35:51 +02:00
#=================================================
# REMOVE APP MAIN DIR
#=================================================
2020-10-25 16:31:23 +01:00
ynh_script_progression --message="Removing app main directory..."
2019-08-13 21:35:51 +02:00
# Remove the app directory securely
2019-08-12 23:55:33 +02:00
ynh_secure_remove --file="$final_path"
#=================================================
2019-08-13 21:35:51 +02:00
# REMOVE NGINX CONFIGURATION
2019-08-12 23:55:33 +02:00
#=================================================
2022-03-03 17:58:37 +01:00
ynh_script_progression --message="Removing NGINX web server configuration..."
2019-08-12 23:55:33 +02:00
2022-03-03 17:58:37 +01:00
# Remove the dedicated NGINX config
2019-08-12 23:55:33 +02:00
ynh_remove_nginx_config
2019-08-13 21:35:51 +02:00
#=================================================
# REMOVE PHP-FPM CONFIGURATION
#=================================================
2022-03-03 17:58:37 +01:00
ynh_script_progression --message="Removing PHP-FPM configuration..."
2019-08-13 21:35:51 +02:00
2022-03-03 17:58:37 +01:00
# Remove the dedicated PHP-FPM config
2019-08-13 21:35:51 +02:00
ynh_remove_fpm_config
#=================================================
# GENERIC FINALIZATION
#=================================================
# REMOVE DEDICATED USER
#=================================================
2020-10-25 16:31:23 +01:00
ynh_script_progression --message="Removing the dedicated system user..."
2019-08-13 21:35:51 +02:00
# Delete a system user
ynh_system_user_delete --username=$app
#=================================================
# END OF SCRIPT
#=================================================
2020-10-31 22:01:13 +01:00
ynh_script_progression --message="Removal of $app completed" --last