qr_ynh/scripts/remove

65 lines
2.1 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
#=================================================
2019-08-13 21:35:51 +02:00
source _common.sh
2019-08-12 23:55:33 +02:00
source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
2019-08-13 21:35:51 +02:00
ynh_script_progression --message="Loading installation settings..." --time --weight=1
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)
2020-03-22 19:02:01 +01:00
#port=$(ynh_app_setting_get --app=$app --key=port)
2019-08-13 21:35:51 +02:00
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
#=================================================
ynh_script_progression --message="Removing app main directory..." --time --weight=1
# 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
#=================================================
2019-08-13 21:35:51 +02:00
ynh_script_progression --message="Removing nginx web server configuration..." --time --weight=1
2019-08-12 23:55:33 +02:00
2019-08-13 21:35:51 +02: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
#=================================================
ynh_script_progression --message="Removing php-fpm configuration..." --time --weight=1
# Remove the dedicated php-fpm config
ynh_remove_fpm_config
#=================================================
# GENERIC FINALIZATION
#=================================================
# REMOVE DEDICATED USER
#=================================================
ynh_script_progression --message="Removing the dedicated system user..." --time --weight=1
# Delete a system user
ynh_system_user_delete --username=$app
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Removal of $app completed" --time --last