summaryrefslogtreecommitdiff
path: root/chat/gale/pkg/INSTALL
blob: e07a53bc55333649456d894066f5733ff246b6c6 (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
35
36
37
38
39
40
41
42
43
44
45
#!/bin/sh
#
# $NetBSD: INSTALL,v 1.3 2001/08/12 19:55:56 veego Exp $

USER=@GALE_USER@
GROUP=@GALE_GROUP@

ADDUSER="@ADDUSER@"
ADDGROUP="@ADDGROUP@"
CHGRP="@CHGRP@"
GREP="@GREP@"
RM="@RM@"
TOUCH="@TOUCH@"

# Group... the default's shipped with NetBSD
# We need to check that ${GROUP} exists before adding the user.
# Do it with chgrp to be able to use NIS.
#
${TOUCH} "/tmp/grouptest.$$"
${CHGRP} ${GROUP} "/tmp/grouptest.$$" >/dev/null 2>&1
if [ $? -eq 0 ]
then
	echo "Group '${GROUP}' already exists...proceeding."
else
	echo "Creating '${GROUP}' group..."
	${ADDGROUP} ${GROUP}
	echo "Done."
fi
${RM} -f "/tmp/grouptest.$$"

# Use `id' to be able to use NIS.
#
id ${USER} 2>/dev/null >/dev/null
if [ $? -eq 0 ]
then
	echo "User '${USER}' already exists...proceeding."
else
	echo "Creating '${USER}' user..."
	${ADDUSER} \
		-c "Gale instant messaging system" \
		-d /var/${USER} \
		-g ${GROUP} -s /bin/sh -m ${USER}
	echo "Done."
fi
exit 0