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

73 lines
2.3 KiB
Text
Raw Normal View History

2014-06-02 13:38:03 +02:00
#!/bin/bash
2018-01-29 00:55:27 +01:00
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
2014-06-02 13:38:03 +02:00
2018-01-29 00:55:27 +01:00
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
2022-03-25 01:09:30 +01:00
ynh_script_progression --message="Loading installation settings..."
2018-01-29 00:55:27 +01:00
app=$YNH_APP_INSTANCE_NAME
2022-03-25 01:09:30 +01:00
domain=$(ynh_app_setting_get --app=$app --key=domain)
port=$(ynh_app_setting_get --app=$app --key=port)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
2018-01-29 00:55:27 +01:00
#=================================================
# STANDARD REMOVE
#=================================================
2022-03-25 01:09:30 +01:00
# REMOVE SUPERVISOR
2018-01-29 00:55:27 +01:00
#=================================================
2022-03-25 01:09:30 +01:00
ynh_script_progression --message="Removing supervisor configuration..."
2018-01-29 00:55:27 +01:00
2022-03-25 01:09:30 +01:00
supervisorctl stop $app
ynh_secure_remove --file="/etc/supervisor/conf.d/$app.conf"
supervisorctl update
2018-01-29 00:55:27 +01:00
#=================================================
2022-03-25 01:09:30 +01:00
# REMOVE APP MAIN DIR
2018-01-29 00:55:27 +01:00
#=================================================
2022-03-25 01:09:30 +01:00
ynh_script_progression --message="Removing app main directory..."
2018-01-29 00:55:27 +01:00
2022-03-25 01:09:30 +01:00
# Remove the app directory securely
ynh_secure_remove --file="$final_path"
2018-01-29 00:55:27 +01:00
#=================================================
2022-03-25 01:09:30 +01:00
# REMOVE NGINX CONFIGURATION
2018-01-29 00:55:27 +01:00
#=================================================
2022-03-25 01:09:30 +01:00
ynh_script_progression --message="Removing NGINX web server configuration..."
2022-03-25 01:09:30 +01:00
# Remove the dedicated NGINX config
ynh_remove_nginx_config
2018-01-29 00:55:27 +01:00
#=================================================
# REMOVE DEPENDENCIES
#=================================================
2022-03-25 01:09:30 +01:00
ynh_script_progression --message="Removing dependencies..."
2018-01-29 00:55:27 +01:00
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
2016-02-03 12:59:58 +01:00
2018-01-29 00:55:27 +01:00
#=================================================
# GENERIC FINALIZATION
#=================================================
# REMOVE DEDICATED USER
#=================================================
2022-03-25 01:09:30 +01:00
ynh_script_progression --message="Removing the dedicated system user..."
2016-02-03 16:48:44 +01:00
2018-01-29 00:55:27 +01:00
# Delete a system user
2022-03-25 01:09:30 +01:00
ynh_system_user_delete --username=$app
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Removal of $app completed"