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

82 lines
2.7 KiB
Text
Raw Normal View History

2015-04-06 17:46:57 +02:00
#!/bin/bash
2017-04-30 15:45:50 +02:00
2020-07-18 20:55:45 +02:00
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
2017-04-30 15:45:50 +02:00
2020-07-18 20:55:45 +02:00
source _common.sh
2017-04-30 15:45:50 +02:00
source /usr/share/yunohost/helpers
2020-07-18 20:55:45 +02:00
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading installation settings..." --time --weight=1
2017-04-30 15:45:50 +02:00
app=$YNH_APP_INSTANCE_NAME
2015-04-06 17:46:57 +02:00
2020-07-18 20:55:45 +02:00
domain=$(ynh_app_setting_get --app=$app --key=domain)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# STANDARD REMOVE
#=================================================
# REMOVE SERVICE INTEGRATION IN YUNOHOST
#=================================================
# Remove the service from the list of services known by Yunohost (added from `yunohost service add`)
if ynh_exec_warn_less yunohost service status $app >/dev/null
then
ynh_script_progression --message="Removing $app service..." --time --weight=1
yunohost service remove $app
fi
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_script_progression --message="Removing dependencies..." --time --weight=1
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
2015-04-06 17:46:57 +02:00
2020-07-18 20:55:45 +02:00
#=================================================
# REMOVE APP MAIN DIR
#=================================================
ynh_script_progression --message="Removing app main directory..." --time --weight=1
# Remove the app directory securely
ynh_secure_remove --file="$final_path"
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
2020-07-25 07:27:37 +02:00
ynh_script_progression --message="Removing NGINX web server configuration..." --time --weight=1
2020-07-18 20:55:45 +02:00
# Remove the dedicated nginx config
ynh_remove_nginx_config
#=================================================
# REMOVE PHP-FPM CONFIGURATION
#=================================================
2020-07-25 07:27:37 +02:00
ynh_script_progression --message="Removing PHP-fpm configuration..." --time --weight=1
2020-07-18 20:55:45 +02:00
# Remove the dedicated php-fpm config
2017-04-30 15:45:50 +02:00
ynh_remove_fpm_config
2015-04-06 17:46:57 +02:00
2020-07-18 20:55:45 +02:00
#=================================================
# 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
#=================================================
2015-04-06 17:46:57 +02:00
2020-07-18 20:55:45 +02:00
ynh_script_progression --message="Removal of $app completed" --time --last