1 |
#! /bin/sh -e |
2 |
|
3 |
case "$1" in |
4 |
install) |
5 |
|
6 |
# Commented out until I can find the official policy on users for debian |
7 |
|
8 |
# create the 'crossfire' group if it doesn't exist |
9 |
# grep ^crossfire: /etc/group >/dev/null || { |
10 |
# /usr/sbin/groupadd crossfire > /dev/null 2>&1 |
11 |
# } |
12 |
|
13 |
# create 'crossfire' user if absent |
14 |
# grep ^crossfire: /etc/passwd >/dev/null || { |
15 |
# /usr/sbin/useradd -d /var/games/crossfire -s /bin/false -g crossfire crossfire |
16 |
# } |
17 |
|
18 |
# check for 'crossfire' user and lock the passwd |
19 |
# grep ^exim: /etc/passwd >/dev/null && { |
20 |
# /usr/bin/passwd -l crossfire > /dev/null 2>&1 |
21 |
# } |
22 |
;; |
23 |
|
24 |
upgrade) |
25 |
# Source debconf library |
26 |
. /usr/share/debconf/confmodule |
27 |
if [ -d /var/lib/games/crossfire/ ] ; then |
28 |
db_input high crossfire-server/ask_upgrade || true |
29 |
db_go || true |
30 |
|
31 |
db_get crossfire-server/ask_upgrade || true |
32 |
if [ "$RET" = "true" ] ; then |
33 |
if [ ! -d /var/games/crossfire/ ] ; then |
34 |
echo "moving /var/lib/games/crossfire/ to /var/games/crossfire" |
35 |
mv -f /var/lib/games/crossfire/ /var/games/ || true |
36 |
if [ -d /var/lib/games/crossfire/ ] ; then |
37 |
if [ "`ls /var/lib/games/crossfire/ | wc -l`" -gt 0 ] ; then |
38 |
echo "Some files remain in /var/lib/games/crossfire/ !" |
39 |
echo "Please move them to /var/games/crossfire" |
40 |
fi |
41 |
fi |
42 |
fi |
43 |
fi |
44 |
|
45 |
fi |
46 |
db_stop || true |
47 |
;; |
48 |
abort-upgrade) |
49 |
# do nothing |
50 |
;; |
51 |
|
52 |
*) |
53 |
echo "$0: incorrect arguments: $*" >&2 |
54 |
exit 1 |
55 |
;; |
56 |
|
57 |
esac |
58 |
|
59 |
##DEBHELPER## |
60 |
|