1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/onlyoffice_ynh.git synced 2024-09-03 19:56:11 +02:00
onlyoffice_ynh/scripts/remove
Éric Gaspar 140bae04ac cleaning
2024-08-02 08:47:03 +02:00

59 lines
2 KiB
Bash

#!/bin/bash
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# REMOVE SERVICE FROM ADMIN PANEL
#=================================================
for service in "ds-converter" "ds-docservice" "ds-metrics"; do
if yunohost service status "$service" >/dev/null 2>&1
then
yunohost service remove "$service"
fi
done
#=================================================
# REMOVE ONLYOFFICE
#=================================================
ynh_script_progression --message="Removing OnlyOffice..."
ynh_secure_remove --file=/var/lib/dpkg/info/onlyoffice-documentserver.prerm
# Here you will wonder what the fuck this is, and the answer is : this is a
# fucking stupid hack because onlyoffice's dev deviced to put a "supervisorctl
# update" inside their postrm, but when their postrm is ran, supervisorctl is
# already removed ... so their removal fails which breaks dpkg.
# So instead, we trick it with this stupid link to /bin/true which is removed
# right after.
#ln -s /bin/true /usr/local/bin/supervisorctl
ynh_package_autopurge onlyoffice-documentserver
dpkg --configure -a
#=================================================
# REMOVE SYSTEM CONFIGURATIONS
#=================================================
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
# Remove the dedicated NGINX config
ynh_remove_nginx_config
#=================================================
# REMOVE VARIOUS FILES
#=================================================
# Remove a directory securely
ynh_secure_remove --file="/etc/onlyoffice"
ynh_secure_remove --file="/var/lib/onlyoffice"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Removal of $app completed"