From ba729bd1d3089ba48b57ff6cab7e4ca21ccb4146 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 13:08:08 +0200 Subject: Adding debian version 1.29.3-4. Signed-off-by: Daniel Baumann --- debian/netdata-core.postrm | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 debian/netdata-core.postrm (limited to 'debian/netdata-core.postrm') diff --git a/debian/netdata-core.postrm b/debian/netdata-core.postrm new file mode 100755 index 0000000..358b2a7 --- /dev/null +++ b/debian/netdata-core.postrm @@ -0,0 +1,44 @@ +#!/bin/sh + +set -e + +case "${1}" in + purge) + # removing directory overrides + for DIRECTORY in /var/cache/netdata /var/lib/netdata + do + if dpkg-statoverride --list | grep -qw "${DIRECTORY}" + then + dpkg-statoverride --remove "${DIRECTORY}" + fi + done + + # removing user + if getent passwd netdata > /dev/null 2>&1 + then + userdel netdata || echo "Unable to remove netdata user" + fi + + # removing group + if getent group netdata > /dev/null 2>&1 + then + groupdel netdata || echo "Unable to remove netdata group" + fi + + # removing directories + rm -rf /var/cache/netdata /var/lib/netdata /var/log/netdata + ;; + + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + + ;; + + *) + echo "postrm called with unknown argument \`${1}'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 -- cgit v1.2.3