ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/mports/trunk/games/pvpgn/pkg-install
Revision: 5122
Committed: Fri May 30 20:07:21 2008 UTC (15 years, 10 months ago) by crash
File size: 1752 byte(s)
Log Message:
add pvpgn

File Contents

# Content
1 #!/bin/sh
2
3 PATH=/bin:/usr/sbin
4
5 case $2 in
6 POST-INSTALL)
7 USER=bnetd
8 GROUP=${USER}
9 UID=700
10 GID=${UID}
11 HOME_DIR=/nonexistent
12 LOGDIR=/var/log/pvpgn
13 PIDDIR=/var/run/pvpgn
14 PKGNAME=$1
15 PVPGN_CONFDIR=${PKG_PREFIX:-/usr/local}/etc/pvpgn
16
17 if pw group show "${GROUP}" 2>/dev/null; then
18 echo "You already have a group \"${GROUP}\", so I will use it."
19 else
20 if pw groupadd ${GROUP} -g ${GID}; then
21 echo "Added group \"${GROUP}\"."
22 else
23 echo "Adding group \"${GROUP}\" failed..."
24 exit 1
25 fi
26 fi
27
28 if pw user show "${USER}" 2>/dev/null; then
29 echo "You already have a user \"${USER}\", so I will use it."
30 else
31 if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
32 -d ${HOME_DIR} -s /sbin/nologin -c "Bnetd user"
33 then
34 echo "Added user \"${USER}\"."
35 else
36 echo "Adding user \"${USER}\" failed..."
37 exit 1
38 fi
39 fi
40
41 mkdir -p %%PVPGN_DIR%%/bak/charinfo
42 mkdir -p %%PVPGN_DIR%%/bak/charsave
43 mkdir -p %%PVPGN_DIR%%/bnmail
44 mkdir -p %%PVPGN_DIR%%/chanlogs
45 mkdir -p %%PVPGN_DIR%%/charinfo
46 mkdir -p %%PVPGN_DIR%%/charsave
47 mkdir -p %%PVPGN_DIR%%/clans
48 mkdir -p %%PVPGN_DIR%%/ladders
49 mkdir -p %%PVPGN_DIR%%/reports
50 mkdir -p %%PVPGN_DIR%%/status
51 mkdir -p %%PVPGN_DIR%%/teams
52 mkdir -p %%PVPGN_DIR%%/users
53 mkdir -p %%PVPGN_DIR%%/userscdb
54
55 chown -R ${USER}:${GROUP} %%PVPGN_DIR%%
56 mkdir -m 750 ${LOGDIR} ${PIDDIR} 2> /dev/null
57 chown -R ${USER}:${GROUP} ${LOGDIR} ${PIDDIR}
58
59 echo "===> Post-installation informations for ${PKGNAME}"
60 echo ""
61 echo " o You can find the configuration files for this"
62 echo " package in the directory ${PVPGN_CONFDIR}."
63 echo " Please note, that the files were installed as *.conf-sample"
64 echo " In order to run server, you must rename them."
65 echo ""
66
67 exit 0
68 ;;
69 esac

Properties

Name Value
cvs2svn:cvs-rev 1.1