1 |
root |
1.1 |
#! /bin/sh -e |
2 |
|
|
|
3 |
|
|
case "$1" in |
4 |
|
|
failed-upgrade|abort-upgrade) |
5 |
|
|
if [ -d /var/lib/games/crossfire/ ] ; then |
6 |
|
|
#only if we really moved everything |
7 |
|
|
if [ "`ls /var/lib/games/crossfire/ | wc -l`" -eq 0 ] ; then |
8 |
|
|
if [ -d /var/games/crossfire/ ] ; then |
9 |
|
|
echo "moving files and directories back to /var/lib/games/crossfire/" |
10 |
|
|
mv /var/games/crossfire/* /var/lib/games/crossfire/ ||true |
11 |
|
|
fi |
12 |
|
|
fi |
13 |
|
|
fi |
14 |
|
|
;; |
15 |
|
|
|
16 |
|
|
abort-install) |
17 |
|
|
# do nothing |
18 |
|
|
;; |
19 |
|
|
|
20 |
|
|
purge) |
21 |
|
|
if [ -e /usr/share/debconf/confmodule ] ; then |
22 |
|
|
. /usr/share/debconf/confmodule |
23 |
|
|
db_purge |
24 |
|
|
fi |
25 |
|
|
##purge game files |
26 |
|
|
if [ -d /var/games/crossfire/ ] ; then |
27 |
|
|
if [ "`ls /var/games/crossfire/ | wc -l`" -gt 0 ] ; then |
28 |
|
|
echo "purging /var/games/crossfire/ and it's contents" |
29 |
|
|
rm -rf /var/games/crossfire/ ||true |
30 |
|
|
fi |
31 |
|
|
fi |
32 |
|
|
##purge logfiles |
33 |
|
|
if [ -d /var/log/crossfire/ ] ; then |
34 |
|
|
if [ "`ls /var/log/crossfire/ | wc -l`" -gt 0 ] ; then |
35 |
|
|
echo "purging /var/games/crossfire/ and it's contents" |
36 |
|
|
rm -rf /var/log/crossfire/ ||true |
37 |
|
|
fi |
38 |
|
|
fi |
39 |
|
|
;; |
40 |
|
|
|
41 |
|
|
upgrade) |
42 |
|
|
# do nothing |
43 |
|
|
;; |
44 |
|
|
remove|disappear) |
45 |
|
|
# remove the 'crossfire' user if it exists |
46 |
|
|
# grep ^crossfire: /etc/passwd >/dev/null && { |
47 |
|
|
# /usr/sbin/userdel crossfire > /dev/null 2>&1 |
48 |
|
|
# } |
49 |
|
|
# |
50 |
|
|
# remove the 'crossfire' group if it exists |
51 |
|
|
# grep ^crossfire: /etc/group >/dev/null || { |
52 |
|
|
# /usr/sbin/groupdel crossfire > /dev/null 2>&1 |
53 |
|
|
# } |
54 |
|
|
;; |
55 |
|
|
*) |
56 |
|
|
echo "$0: incorrect arguments: $*" >&2 |
57 |
|
|
exit 1 |
58 |
|
|
;; |
59 |
|
|
|
60 |
|
|
esac |
61 |
|
|
|
62 |
|
|
##DEBHELPER## |
63 |
|
|
|