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

82 lines
2.6 KiB
Text
Raw Normal View History

#!/bin/bash
2017-10-06 16:35:33 +02:00
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
app=$YNH_APP_INSTANCE_NAME
2021-07-21 15:40:31 +02: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)
2017-10-06 16:35:33 +02:00
#=================================================
# STANDARD REMOVE
#=================================================
2020-11-03 15:33:26 +01:00
# REMOVE SERVICE INTEGRATION IN YUNOHOST
2017-10-06 16:35:33 +02:00
#=================================================
2020-11-03 15:33:26 +01: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
2017-10-06 16:35:33 +02:00
then
2020-11-03 16:07:39 +01:00
ynh_script_progression --message="Removing $app service integration..." --weight=2
2017-10-06 16:35:33 +02:00
yunohost service remove $app
fi
#=================================================
2020-11-03 15:33:26 +01:00
# STOP AND REMOVE SERVICE
2017-10-06 16:31:38 +02:00
#=================================================
2020-11-03 16:07:39 +01:00
ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1
2017-10-06 16:31:38 +02:00
2020-11-03 15:33:26 +01:00
# Remove the dedicated systemd config
ynh_remove_systemd_config
2017-10-06 16:35:33 +02:00
#=================================================
2020-11-03 15:33:26 +01:00
# REMOVE DEPENDENCIES
2017-10-06 16:35:33 +02:00
#=================================================
2020-11-03 16:07:39 +01:00
ynh_script_progression --message="Removing dependencies..." --weight=2
2017-10-06 16:35:33 +02:00
2020-11-03 15:33:26 +01:00
# Remove metapackage and its dependencies
2021-09-08 10:28:31 +02:00
ynh_remove_nodejs
2017-10-06 16:35:33 +02:00
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
2020-11-03 16:07:39 +01:00
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1
2017-10-06 16:35:33 +02:00
2020-11-03 16:07:39 +01:00
# Remove the dedicated NGINX config
2017-10-06 16:35:33 +02:00
ynh_remove_nginx_config
#=================================================
2020-11-03 15:33:26 +01:00
# REMOVE APP MAIN DIR
2017-10-06 16:35:33 +02:00
#=================================================
2020-11-03 16:07:39 +01:00
ynh_script_progression --message="Removing app main directory..." --weight=2
2017-10-06 16:35:33 +02:00
2020-11-03 15:33:26 +01:00
# Remove the app directory securely
ynh_secure_remove --file="$final_path"
2017-10-06 16:35:33 +02:00
#=================================================
2020-11-03 15:33:26 +01:00
# GENERIC FINALIZATION
2017-10-06 16:35:33 +02:00
#=================================================
2020-11-03 15:33:26 +01:00
# REMOVE DEDICATED USER
2017-10-06 16:35:33 +02:00
#=================================================
2020-11-03 16:07:39 +01:00
ynh_script_progression --message="Removing the dedicated system user..." --weight=1
2017-10-06 16:35:33 +02:00
2020-11-03 15:33:26 +01:00
# Delete a system user
ynh_system_user_delete --username=$app
2017-10-06 16:35:33 +02:00
#=================================================
2020-11-03 15:33:26 +01:00
# END OF SCRIPT
2017-10-06 16:35:33 +02:00
#=================================================
2020-11-03 16:07:39 +01:00
ynh_script_progression --message="Removal of $app completed" --last