diff options
Diffstat (limited to 'packaging/cmake/pkg-files/deb/netdata/postrm')
-rwxr-xr-x | packaging/cmake/pkg-files/deb/netdata/postrm | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/packaging/cmake/pkg-files/deb/netdata/postrm b/packaging/cmake/pkg-files/deb/netdata/postrm new file mode 100755 index 000000000..7a636863b --- /dev/null +++ b/packaging/cmake/pkg-files/deb/netdata/postrm @@ -0,0 +1,55 @@ +#!/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 /usr/share/netdata/www; then + dpkg-statoverride --remove /usr/share/netdata/www + fi + + if dpkg-statoverride --list | grep -qw /var/lib/netdata/registry; then + dpkg-statoverride --remove /var/lib/netdata/registry + fi + + if dpkg-statoverride --list | grep -qw /var/lib/netdata; then + dpkg-statoverride --remove /var/lib/netdata + fi + + if dpkg-statoverride --list | grep -qw /var/run/netdata; then + dpkg-statoverride --remove /var/run/netdata + fi + + if dpkg-statoverride --list | grep -qw /var/log/netdata; then + dpkg-statoverride --remove /var/log/netdata + fi + ;; + + *) ;; + +esac + +if [ "$1" = "remove" ]; then + if [ -x "/usr/bin/deb-systemd-helper" ]; then + deb-systemd-helper mask 'netdata.service' >/dev/null || true + fi +fi + +if [ "$1" = "purge" ]; then + if [ -x "/usr/bin/deb-systemd-helper" ]; then + deb-systemd-helper purge 'netdata.service' >/dev/null || true + deb-systemd-helper unmask 'netdata.service' >/dev/null || true + fi +fi + +exit 0 |