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

85 lines
2.7 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
2022-05-05 02:45:58 +02:00
source ynh_supervisor
2018-01-29 00:55:27 +01:00
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-05-05 02:45:58 +02:00
# REMOVE SERVICE INTEGRATION IN YUNOHOST
2018-01-29 00:55:27 +01:00
#=================================================
2022-05-05 02:45:58 +02:00
# 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 integration..."
yunohost service remove $app
fi
#=================================================
# STOP AND REMOVE SERVICE
#=================================================
ynh_script_progression --message="Stopping and removing the systemd service..."
# Remove the dedicated systemd config
ynh_remove_supervisor_config
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
2022-05-05 02:45:58 +02:00
ynh_remove_nodejs
2018-01-29 00:55:27 +01:00
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"