summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2024-11-10 16:43:46 +0100
committerDaniel Baumann <daniel@debian.org>2024-11-10 17:11:18 +0100
commit331b9d1e1eaad87cfbc28f2709e5079cd53b1ae0 (patch)
tree4f5b9bbbc009a3558932beaa9c70f1e1dc4f2117
parentRewriting frr.postinst in policy compliant way. (diff)
downloadfrr-331b9d1e1eaad87cfbc28f2709e5079cd53b1ae0.tar.xz
frr-331b9d1e1eaad87cfbc28f2709e5079cd53b1ae0.zip
Rewriting frr.postrm in policy compliant way.
Signed-off-by: Daniel Baumann <daniel@debian.org>
-rwxr-xr-xdebian/frr.postrm27
1 files 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