1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/bozon_ynh.git synced 2024-09-03 18:16:09 +02:00
bozon_ynh/scripts/remove

65 lines
2.4 KiB
Text
Raw Normal View History

#!/bin/bash
# to test the functionnality :
# yunohost app remove bozon
2016-03-23 19:30:43 +01:00
2020-01-05 19:49:24 +01:00
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
2016-10-13 06:51:38 +02:00
source /usr/share/yunohost/helpers
2016-05-23 21:40:55 +02:00
2020-01-05 19:49:24 +01:00
#=================================================
# LOAD SETTINGS
#=================================================
2020-11-27 07:20:16 +01:00
ynh_script_progression --message="Loading installation settings..." --weight=1
2016-10-13 06:51:38 +02:00
app=$YNH_APP_INSTANCE_NAME
2020-01-05 19:49:24 +01:00
domain=$(ynh_app_setting_get --app="$app" --key=domain)
final_path=$(ynh_app_setting_get --app="$app" --key=final_path)
data_path=$(ynh_app_setting_get --app="$app" --key=data_path)
2016-03-23 19:30:43 +01:00
2020-01-05 19:49:24 +01:00
#=================================================
# STANDARD REMOVE
#=================================================
# REMOVE DEPENDENCIES
#=================================================
2020-11-27 07:20:16 +01:00
ynh_script_progression --message="Removing dependencies..." --weight=1
ynh_remove_app_dependencies
2020-01-05 19:49:24 +01:00
#=================================================
# REMOVE APP MAIN DIR
#=================================================
2020-11-27 07:20:16 +01:00
ynh_script_progression --message="Removing app main directory..." --weight=1
2020-01-05 19:49:24 +01:00
ynh_secure_remove --file="$final_path"
2020-01-05 19:49:24 +01:00
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
2020-11-27 07:20:16 +01:00
ynh_script_progression --message="Removing nginx web server configuration..." --weight=1
2017-09-22 19:33:28 +02:00
ynh_remove_nginx_config
2020-01-05 19:49:24 +01:00
#=================================================
# REMOVE PHP-FPM CONFIGURATION
#=================================================
2020-11-27 07:20:16 +01:00
ynh_script_progression --message="Removing php-fpm configuration..." --weight=1
2017-09-22 19:33:28 +02:00
ynh_remove_fpm_config
2020-01-05 19:49:24 +01:00
#=================================================
# SPECIFIC REMOVE
#=================================================
ynh_secure_remove --file="$data_path"
#=================================================
# GENERIC FINALIZATION
#=================================================
# REMOVE DEDICATED USER
#=================================================
2020-11-27 07:20:16 +01:00
ynh_script_progression --message="Removing the dedicated system user..." --weight=1
2020-01-05 19:49:24 +01:00
ynh_system_user_delete --username="$app"
2020-01-05 19:49:24 +01:00
#=================================================
# END OF SCRIPT
#=================================================
2020-11-27 07:20:16 +01:00
ynh_script_progression --message="Removal of $app completed" --last