2017-06-21 11:34:24 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-11-03 10:30:12 +01:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
2017-06-21 11:34:24 +02:00
|
|
|
|
2018-11-03 10:30:12 +01:00
|
|
|
source _common.sh
|
2017-06-21 11:34:24 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2018-11-03 10:30:12 +01:00
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
2021-06-26 08:19:34 +02:00
|
|
|
ynh_script_progression --message="Loading installation settings..." --weight=1
|
2018-11-03 10:30:12 +01:00
|
|
|
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
|
2019-08-04 23:00:10 +02:00
|
|
|
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
|
|
|
port=$(ynh_app_setting_get --app=$app --key=port)
|
2018-11-03 10:30:12 +01:00
|
|
|
|
2021-06-26 09:23:07 +02:00
|
|
|
#=================================================
|
|
|
|
# REMOVE SERVICE INTEGRATION IN YUNOHOST
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
# 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..." --weight=1
|
|
|
|
yunohost service remove $app
|
|
|
|
fi
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STOP AND REMOVE SERVICE
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1
|
|
|
|
|
|
|
|
# Remove the dedicated systemd config
|
|
|
|
ynh_remove_systemd_config --service="loolwsd"
|
|
|
|
|
2018-11-03 10:30:12 +01:00
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
|
|
|
# REMOVE DEPENDENCIES
|
|
|
|
#=================================================
|
2021-06-26 08:19:34 +02:00
|
|
|
ynh_script_progression --message="Removing dependencies..." --weight=1
|
2018-11-03 10:30:12 +01:00
|
|
|
|
2019-01-31 00:19:51 +01:00
|
|
|
# Fix "rm: cannot remove '/etc/apt/apt.conf.d/25loolwsd': No such file or directory"
|
|
|
|
# on apt remove
|
|
|
|
touch /etc/apt/apt.conf.d/25loolwsd
|
2019-08-04 23:00:10 +02:00
|
|
|
|
2018-11-03 10:30:12 +01:00
|
|
|
# Remove metapackage and its dependencies
|
|
|
|
ynh_remove_app_dependencies
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE NGINX CONFIGURATION
|
|
|
|
#=================================================
|
2021-06-26 08:19:34 +02:00
|
|
|
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1
|
2018-11-03 10:30:12 +01:00
|
|
|
|
2020-09-22 16:57:16 +02:00
|
|
|
# Remove the dedicated NGINX config
|
2018-11-03 10:30:12 +01:00
|
|
|
ynh_remove_nginx_config
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SPECIFIC REMOVE
|
|
|
|
#=================================================
|
2019-08-04 23:00:10 +02:00
|
|
|
|
2018-11-03 10:30:12 +01:00
|
|
|
# Remove a directory securely
|
2020-04-16 01:53:52 +02:00
|
|
|
ynh_secure_remove --file="/etc/loolwsd"
|
2017-06-21 11:34:24 +02:00
|
|
|
|
2018-11-03 10:30:12 +01:00
|
|
|
#=================================================
|
2019-08-04 23:00:10 +02:00
|
|
|
# END OF SCRIPT
|
2018-11-03 10:30:12 +01:00
|
|
|
#=================================================
|
2017-06-21 11:34:24 +02:00
|
|
|
|
2021-06-26 08:19:34 +02:00
|
|
|
ynh_script_progression --message="Removal of $app completed" --last
|