From 17a4b90196fc366b302434a0646e521a3c8b33a0 Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Sun, 12 Jul 2020 12:13:18 +0200 Subject: Add some more fixes to Debian packaging --- debian/minecproxy.postrm | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 debian/minecproxy.postrm (limited to 'debian/minecproxy.postrm') diff --git a/debian/minecproxy.postrm b/debian/minecproxy.postrm new file mode 100644 index 0000000..32e1cd4 --- /dev/null +++ b/debian/minecproxy.postrm @@ -0,0 +1,34 @@ +#!/bin/sh + +set -e + +if [ -e "/usr/share/debconf/confmodule" ]; then + . /usr/share/debconf/confmodule +fi + +# Check if the system-wide Minecraft worlds should be removed on purge +remove_worlds_on_purge() { + db_get minecproxy/purge_database || RET=false + if [ "$RET" = "true" ]; then + return 0 + else + return 1 + fi +} + +case "$1" in +purge) + # Don't remove minecproxy user on purge (for now). + # See the discussion in Debian bug #621833. + + if remove_worlds_on_purge; then + echo -n "Purging Minecraft worlds... " + rm -rf /var/lib/minecproxy || true + echo done + fi + ;; +esac + +#DEBHELPER# + +exit 0 -- cgit v1.2.3