summaryrefslogtreecommitdiff
path: root/debian/minecproxy.postrm
blob: 32e1cd457ff9ee822d6299693a3c320d0e6fffd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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