summaryrefslogtreecommitdiff
path: root/debian/minecproxy.postrm
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2020-07-12 12:13:18 +0200
committerDavid Härdeman <david@hardeman.nu>2020-07-12 12:13:18 +0200
commit17a4b90196fc366b302434a0646e521a3c8b33a0 (patch)
tree45b295ab814ac0c8556a50e687cd9918961c34e3 /debian/minecproxy.postrm
parent6db27716de7227fbd9c08a85d7ee9eeb38d17f74 (diff)
Add some more fixes to Debian packaging
Diffstat (limited to 'debian/minecproxy.postrm')
-rw-r--r--debian/minecproxy.postrm34
1 files changed, 34 insertions, 0 deletions
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