#!/bin/bash
VERSION=1

. /usr/share/univention-lib/ldap.sh
. /usr/share/univention-appcenter/joinscripthelper.sh

joinscript_init

eval "$(ucr shell)"

ucs_removeServiceFromLocalhost "${SERVICE}" "$@"

if [ -e "/etc/apache2/ucs-sites.conf.d/rocketchat.conf" ]; then
    echo "Remove custom reverse proxy configuration"
    rm /etc/apache2/ucs-sites.conf.d/rocketchat.conf
    echo "Leave Apache2 module proxy_wstunnel untouched, because it may be used by another service. If it should be deactivated, execute 'a2dismod proxy_wstunnel' and 'service apache2 reload' manually."
fi

joinscript_remove_script_from_status_file "$APP"
exit 0