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

68 lines
2.2 KiB
Text
Raw Normal View History

2017-01-28 22:50:08 +01:00
#!/bin/bash
2018-03-24 01:27:49 +01:00
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
2017-01-29 16:25:11 +01:00
source /usr/share/yunohost/helpers
2018-03-24 01:27:49 +01:00
#=================================================
2020-04-02 18:02:34 +02:00
# LOAD SETTINGS
2018-03-24 01:27:49 +01:00
#=================================================
ynh_script_progression --message="Loading installation settings..." --time --weight=1
2018-03-24 01:27:49 +01:00
2020-04-02 16:34:46 +02:00
app=$YNH_APP_INSTANCE_NAME
2018-03-24 01:27:49 +01:00
domain=$(ynh_app_setting_get --app=$app --key=domain)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
2018-03-24 01:27:49 +01:00
2020-03-31 20:50:30 +02:00
#=================================================
2020-04-02 18:02:34 +02:00
# REMOVE DEPENDENCIES
2020-03-31 20:50:30 +02:00
#=================================================
ynh_script_progression --message="Removing dependencies..." --time --weight=1
2020-03-31 20:50:30 +02:00
2020-04-02 18:02:34 +02:00
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
2020-03-31 20:50:30 +02:00
2018-03-24 01:27:49 +01:00
#=================================================
2020-04-02 18:02:34 +02:00
# REMOVE APP MAIN DIR
2018-03-24 01:27:49 +01:00
#=================================================
ynh_script_progression --message="Removing app main directory..." --time --weight=1
2018-03-24 01:27:49 +01:00
2020-04-02 18:02:34 +02:00
# Remove the app directory securely
ynh_secure_remove --file="$final_path"
2018-03-24 01:27:49 +01:00
#=================================================
2020-04-02 18:02:34 +02:00
# REMOVE NGINX CONFIGURATION
2018-03-24 01:27:49 +01:00
#=================================================
ynh_script_progression --message="Removing nginx web server configuration..." --time --weight=1
2018-03-24 01:27:49 +01:00
2020-04-02 18:02:34 +02:00
# Remove the dedicated nginx config
ynh_remove_nginx_config
2018-03-24 01:27:49 +01:00
#=================================================
2020-04-02 18:02:34 +02:00
# REMOVE PHP-FPM CONFIGURATION
2018-03-24 01:27:49 +01:00
#=================================================
ynh_script_progression --message="Removing php-fpm configuration..." --time --weight=1
2018-03-24 01:27:49 +01:00
2020-04-02 18:02:34 +02:00
# Remove the dedicated php-fpm config
ynh_remove_fpm_config
2017-01-28 22:50:08 +01:00
2020-03-31 20:50:30 +02:00
#=================================================
2020-04-02 18:02:34 +02:00
# GENERIC FINALIZATION
2020-03-31 17:43:53 +02:00
#=================================================
2020-04-02 18:02:34 +02:00
# REMOVE DEDICATED USER
2020-03-31 17:43:53 +02:00
#=================================================
ynh_script_progression --message="Removing the dedicated system user..." --time --weight=1
2020-03-31 17:43:53 +02:00
2020-04-02 18:02:34 +02:00
# Delete a system user
ynh_system_user_delete --username=$app
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Removal of $app completed" --time --last