Edit file File name : prometheus-node-exporter.postrm Content :#!/bin/sh # postrm script for prometheus-node-exporter # Script executed after the package is removed. set -e case "$1" in purge) rm -rf /var/lib/prometheus/node-exporter/ \ /var/log/prometheus/prometheus-node-exporter.log \ /var/log/prometheus/prometheus-node-exporter.log.* \ /run/prometheus/prometheus-node-exporter.pid # We do NOT remove the system user. ;; esac # Automatically added by dh_installinit/13.6ubuntu1 if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = "purge" ] ; then update-rc.d prometheus-node-exporter remove >/dev/null fi # End automatically added section # Automatically added by dh_installsystemd/13.6ubuntu1 if [ "$1" = remove ] && [ -d /run/systemd/system ] ; then systemctl --system daemon-reload >/dev/null || true fi # End automatically added section # Automatically added by dh_installsystemd/13.6ubuntu1 if [ "$1" = "remove" ]; then if [ -x "/usr/bin/deb-systemd-helper" ]; then deb-systemd-helper mask 'prometheus-node-exporter.service' >/dev/null || true fi fi if [ "$1" = "purge" ]; then if [ -x "/usr/bin/deb-systemd-helper" ]; then deb-systemd-helper purge 'prometheus-node-exporter.service' >/dev/null || true deb-systemd-helper unmask 'prometheus-node-exporter.service' >/dev/null || true fi fi # End automatically added section Save