summaryrefslogtreecommitdiff
path: root/debian/minecproxy.postrm
diff options
context:
space:
mode:
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