#!/bin/bash # Copyright (C) 2024 Pädagogisches Landesinstitut Rheinland-Pfalz # Copyright (C) 2024 Daniel Teichmann # Copyright (C) 2023 Mike Gabriel # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the # Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # prerm script for debian-edu-router-plugin.content-filter set -e . /usr/share/debconf/confmodule || exit 255 # prepare debconf export DC_PRIO_LOW="medium" export DC_PRIO_HIGH="high" if [ -e /etc/debian-edu/router.conf ]; then source /etc/debian-edu/router.conf fi PRODUCTNAME="${PRODUCTNAME:-"Debian Edu Router"}" PRODUCTNAME_PLUGIN_SUFFIX="${PRODUCTNAME_PLUGIN_SUFFIX:-"Plugin"}" PRODUCTNAME_PLUGIN="${PRODUCTNAME_PLUGIN:-"${PRODUCTNAME} ${PRODUCTNAME_PLUGIN_SUFFIX}: Content filter"}" db_title "${PRODUCTNAME_PLUGIN}" # summary of how this script can be called: # * `remove' # * `upgrade' # * `failed-upgrade' # * `remove' `in-favour' # * `deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "${1}" in 'remove') echo "Removing blacklists via 'debian-edu-router_refresh-blacklists --purge-filterlists'..." debian-edu-router_refresh-blacklists --purge-filterlists ;; 'failed-upgrade'|'deconfigure') ;; 'upgrade') ;; *) echo "postrm called with unknown argument '${1}'" >&2 exit '1' ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. # Automatically added by dh_installsystemd/13.24.2 if [ -z "$DPKG_ROOT" ] && [ "$1" = remove ] && [ -d /run/systemd/system ] ; then deb-systemd-invoke stop 'e2guardian_d-e-r.service' 'squid_d-e-r.target' 'squid_d-e-r_acl_watcher.path' 'squid_d-e-r_acl_watcher.service' 'squid_d-e-r_refresh-blacklists.service' 'squid_d-e-r_refresh-blacklists.timer' 'squid_d-e-r_refresh-generated-ips.service' 'squid_d-e-r_refresh-generated-ips.timer' >/dev/null || true fi # End automatically added section exit '0'