summaryrefslogtreecommitdiffstats
path: root/debian/netdata-core.postrm
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 02:58:04 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 02:58:04 +0000
commit89f8d515746f459d7ca8e6261bd590bd1b4602bd (patch)
treee419fa4503aef64498a4e74697f5b35b26e9c8d6 /debian/netdata-core.postrm
parentAdding upstream version 1.44.3. (diff)
downloadnetdata-debian.tar.xz
netdata-debian.zip
Adding debian version 1.44.3-2.debian/1.44.3-2debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/netdata-core.postrm')
-rwxr-xr-xdebian/netdata-core.postrm44
1 files changed, 44 insertions, 0 deletions
diff --git a/debian/netdata-core.postrm b/debian/netdata-core.postrm
new file mode 100755
index 00000000..358b2a77
--- /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