2019-02-20 12:08:50 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
2022-09-03 00:44:25 +02:00
|
|
|
ynh_script_progression --message="Loading installation settings..." --weight=1
|
2019-02-20 12:08:50 +01:00
|
|
|
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
|
2022-03-13 21:51:45 +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)
|
2019-02-20 12:08:50 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
2020-11-16 19:38:35 +01:00
|
|
|
# REMOVE SERVICE INTEGRATION IN YUNOHOST
|
2019-04-10 11:19:13 +02:00
|
|
|
#=================================================
|
|
|
|
|
2022-03-13 21:51:45 +01:00
|
|
|
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
|
2020-11-16 19:38:35 +01:00
|
|
|
if ynh_exec_warn_less yunohost service status $app >/dev/null
|
2019-04-10 11:19:13 +02:00
|
|
|
then
|
2022-05-31 01:08:23 +02:00
|
|
|
ynh_script_progression --message="Removing $app service integration..." --weight=1
|
2022-03-13 21:51:45 +01:00
|
|
|
yunohost service remove $app
|
2019-04-10 11:19:13 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STOP AND REMOVE SERVICE
|
|
|
|
#=================================================
|
2020-11-16 19:38:35 +01:00
|
|
|
ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1
|
2019-02-20 12:08:50 +01:00
|
|
|
|
2019-04-10 11:19:13 +02:00
|
|
|
# Remove the dedicated systemd config
|
2022-03-13 21:51:45 +01:00
|
|
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE NGINX CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=5
|
|
|
|
|
|
|
|
# Remove the dedicated NGINX config
|
|
|
|
ynh_remove_nginx_config
|
2019-02-20 12:08:50 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE DEPENDENCIES
|
|
|
|
#=================================================
|
2020-11-16 19:38:35 +01:00
|
|
|
ynh_script_progression --message="Removing dependencies..." --weight=1
|
2019-02-20 12:08:50 +01:00
|
|
|
|
|
|
|
# Remove metapackage and its dependencies
|
2019-04-10 11:19:13 +02:00
|
|
|
ynh_remove_app_dependencies
|
2019-02-20 12:08:50 +01:00
|
|
|
|
|
|
|
#=================================================
|
2022-03-13 21:51:45 +01:00
|
|
|
# SPECIFIC REMOVE
|
2019-02-20 12:08:50 +01:00
|
|
|
#=================================================
|
2022-03-13 21:51:45 +01:00
|
|
|
# REMOVE VARIOUS FILES
|
|
|
|
#=================================================
|
2022-09-03 00:44:25 +02:00
|
|
|
ynh_script_progression --message="Removing various files..." --weight=1
|
2019-02-20 12:08:50 +01:00
|
|
|
|
2022-03-13 21:51:45 +01:00
|
|
|
# Remove a directory securely
|
|
|
|
ynh_secure_remove --file="/etc/$app"
|
2019-02-20 12:08:50 +01:00
|
|
|
|
2019-04-10 11:19:13 +02:00
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2021-07-07 19:08:59 +02:00
|
|
|
ynh_script_progression --message="Removal of $app completed" --last
|