From 331b9d1e1eaad87cfbc28f2709e5079cd53b1ae0 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 10 Nov 2024 16:43:46 +0100 Subject: Rewriting frr.postrm in policy compliant way. Signed-off-by: Daniel Baumann --- debian/frr.postrm | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/debian/frr.postrm b/debian/frr.postrm index c553abd9..e24a6ace 100755 --- a/debian/frr.postrm +++ b/debian/frr.postrm @@ -1,15 +1,26 @@ #!/bin/sh + set -e -rm -f /etc/frr/.pkg.frr.nointegrated +case "${1}" in + purge) + rm -f /etc/frr/.pkg.frr.nointegrated + rmdir /etc/frr > /dev/null 2>&1 || true + + rm -rf /run/frr + rm -rf /var/lib/frr + ;; -if [ "$1" = "purge" ]; then - rm -rf /run/frr || true - rm -rf /var/lib/frr || true + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) - # "purge" does not remove logfiles. therefore we shouldn't delete - # the "frr" user/group since that would leave files with "dangling" - # ownership. -fi + ;; + + *) + echo "postrm called with unknown argument \`${1}'" >&2 + exit 1 + ;; +esac #DEBHELPER# + +exit 0 -- cgit v1.2.3