diff options
author | Matthew Newton <mcn4@leicester.ac.uk> | 2016-04-01 17:25:54 +0100 |
---|---|---|
committer | Matthew Newton <mcn4@leicester.ac.uk> | 2016-04-08 23:37:27 +0100 |
commit | 62d8fc5c2279613fe86456ff0f6c99ad699d6ca4 (patch) | |
tree | 868dcda180914e767a9adbdf3c8c6f7d4f84be93 /contrib/debian/netdata.postrm | |
parent | 20d02ef9a8263ade48fe5480edf36725529e5487 (diff) |
Add Debian packaging
Diffstat (limited to 'contrib/debian/netdata.postrm')
-rw-r--r-- | contrib/debian/netdata.postrm | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/contrib/debian/netdata.postrm b/contrib/debian/netdata.postrm new file mode 100644 index 0000000000..4ab4eeadd9 --- /dev/null +++ b/contrib/debian/netdata.postrm @@ -0,0 +1,43 @@ +#! /bin/sh + +set -e + +case "$1" in + remove) + ;; + + purge) + if dpkg-statoverride --list | grep -qw /var/cache/netdata; then + dpkg-statoverride --remove /var/cache/netdata + fi + + if dpkg-statoverride --list | grep -qw /var/lib/netdata/www; then + dpkg-statoverride --remove /var/lib/netdata/www + fi + + if dpkg-statoverride --list | grep -qw /var/lib/netdata; then + dpkg-statoverride --remove /var/lib/netdata + fi + + if getent passwd netdata >/dev/null; then + if [ -x /usr/sbin/deluser ]; then + deluser --quiet --system netdata || echo "Unable to remove netdata user" + fi + fi + + if getent group netdata >/dev/null; then + if [ -x /usr/sbin/delgroup ]; then + delgroup --quiet --system netdata || echo "Unable to remove netdata group" + fi + fi + + ;; + + *) + ;; +esac + +#DEBHELPER# + +exit 0 + |