2015-05-24 23:01:16 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-11-25 19:38:26 +01:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
2017-02-21 14:51:22 +01:00
|
|
|
|
2021-11-25 19:38:26 +01:00
|
|
|
source _common.sh
|
2016-05-31 15:26:06 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
2021-11-25 19:38:26 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
2022-05-02 19:22:58 +02:00
|
|
|
ynh_script_progression --message="Loading installation settings…"
|
2016-05-31 15:26:06 +02:00
|
|
|
|
2016-06-23 13:27:00 +02:00
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
2015-12-25 21:33:56 +01:00
|
|
|
|
2021-11-25 19:38:26 +01:00
|
|
|
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
2022-03-12 16:55:59 +01:00
|
|
|
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
2015-12-02 21:41:55 +01:00
|
|
|
|
2022-03-12 16:55:59 +01:00
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
2021-11-25 19:38:26 +01:00
|
|
|
#=================================================
|
|
|
|
# REMOVE SERVICE INTEGRATION IN YUNOHOST
|
|
|
|
#=================================================
|
2018-11-29 17:46:37 +01:00
|
|
|
|
2021-11-25 19:38: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
|
|
|
|
then
|
2022-05-02 19:22:58 +02:00
|
|
|
ynh_script_progression --message="Removing $app service integration…"
|
2021-11-25 19:38:26 +01:00
|
|
|
yunohost service remove $app
|
|
|
|
fi
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STOP AND REMOVE SERVICE
|
|
|
|
#=================================================
|
2022-05-02 19:22:58 +02:00
|
|
|
ynh_script_progression --message="Stopping and removing the systemd service…"
|
2021-11-25 19:38:26 +01:00
|
|
|
|
|
|
|
# Remove the dedicated systemd config
|
|
|
|
ynh_remove_systemd_config
|
2016-06-28 13:55:13 +02:00
|
|
|
|
2021-11-25 19:38:26 +01:00
|
|
|
#=================================================
|
2022-03-12 16:55:59 +01:00
|
|
|
# REMOVE DATA DIR
|
2021-11-25 19:38:26 +01:00
|
|
|
#=================================================
|
2015-12-02 21:41:55 +01:00
|
|
|
|
2022-03-12 16:55:59 +01:00
|
|
|
# Remove the data directory if --purge option is used
|
|
|
|
if [ "${YNH_APP_PURGE:-0}" -eq 1 ]
|
|
|
|
then
|
2022-05-02 19:22:58 +02:00
|
|
|
ynh_script_progression --message="Removing app data directory…"
|
2022-03-12 16:55:59 +01:00
|
|
|
ynh_secure_remove --file="$datadir"
|
|
|
|
fi
|
2015-12-25 21:33:56 +01:00
|
|
|
|
2021-11-25 19:38:26 +01:00
|
|
|
#=================================================
|
|
|
|
# REMOVE NGINX CONFIGURATION
|
|
|
|
#=================================================
|
2022-05-02 19:22:58 +02:00
|
|
|
ynh_script_progression --message="Removing NGINX web server configuration…"
|
2021-11-25 19:38:26 +01:00
|
|
|
|
|
|
|
# Remove the dedicated NGINX config
|
|
|
|
ynh_remove_nginx_config
|
|
|
|
|
2022-03-12 16:55:59 +01:00
|
|
|
#=================================================
|
|
|
|
# REMOVE DEPENDENCIES
|
|
|
|
#=================================================
|
2022-05-02 19:22:58 +02:00
|
|
|
ynh_script_progression --message="Removing dependencies…"
|
2022-03-12 16:55:59 +01:00
|
|
|
|
|
|
|
dpkg -r duniter
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALIZATION
|
|
|
|
#=================================================
|
|
|
|
# REMOVE DEDICATED USER
|
|
|
|
#=================================================
|
2022-05-02 19:22:58 +02:00
|
|
|
ynh_script_progression --message="Removing the dedicated system user…"
|
2022-03-12 16:55:59 +01:00
|
|
|
|
|
|
|
# Delete a system user
|
|
|
|
ynh_system_user_delete --username=$app
|
2020-06-11 19:00:12 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2022-03-12 16:55:59 +01:00
|
|
|
ynh_script_progression --message="Removal of $app completed"
|