summaryrefslogtreecommitdiff
path: root/games/atitd/pkg-deinstall
blob: 1d3cccf428b936de3ff2de77799f2c1069c66059 (plain) (blame)
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
35
36
37
38
39
#!/bin/sh

PATH=/bin:/usr/sbin

if [ -n "${PACKAGE_BUILDING}" ]; then
        exit 0
fi

case $2 in
DEINSTALL)
	rm -fr ${PKG_PREFIX}/games/atitd

	;;

POST-DEINSTALL)
	PW=/usr/sbin/pw
	USER=atitd
	GROUP=atitd

	echo -n "Checking for group '$GROUP'... "

	if ! ${PW} groupshow $GROUP >/dev/null 2>&1; then
		echo "doesn't exist."
	else
		echo "deleting."
		${PW} groupdel -n ${GROUP}
	fi

	echo -n "Checking for user '$USER'... "

	if ! ${PW} usershow $USER >/dev/null 2>&1; then
		echo "doesn't exist."
	else
		echo "deleting."
		${PW} userdel -n ${USER}
	fi

	;;
esac