blob: c2b9764fd4133470848d1a2830d2c239e0e401fb (
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
46
47
48
49
50
51
52
53
|
#!/bin/sh
#
# $NetBSD: INSTALL,v 1.2 2001/03/01 19:07:52 jlam Exp $
PKGNAME=$1
STAGE=$2
JB_USER=@JB_USER@
JB_USERID=@JB_USERID@
JB_GROUP=@JB_GROUP@
JB_GROUPID=@JB_GROUPID@
ADDUSER=@ADDUSER@
ADDGROUP=@ADDGROUP@
CHGRP=@CHGRP@
ID=@ID@
TOUCH=@TOUCH@
RM=@RM@
if [ "$STAGE" != "PRE-INSTALL" ];
then
exit 0
fi
# We need to check that ${JB_GROUP} exists before adding the user.
#
${TOUCH} "/tmp/grouptestjitterbug.$$"
${CHGRP} ${JB_GROUP} "/tmp/grouptestjitterbug.$$" >/dev/null 2>&1
if [ $? -eq 0 ]; then
echo "Group '${JB_GROUP}' already exists...proceeding."
else
echo "Creating '${JB_GROUP}' group..."
if ! ${ADDGROUP} -g ${JB_GROUPID} ${JB_GROUP}
then
echo "Can't add group ${JB_GROUP} with gid ${JB_GROUPID}"
echo "Please do it manually and restart installation."
${RM} -f "/tmp/grouptestjitterbug.$$"
exit 1
fi
echo "Done."
fi
${RM} -f "/tmp/grouptestjitterbug.$$"
${ID} ${JB_USER} >/dev/null 2>&1
if [ $? -eq 0 ]; then
echo "User '${JB_USER}' already exists...proceeding."
else
echo "Creating '${JB_USER}' user..."
${ADDUSER} -c "Jitterbug Administrator" -g ${JB_GROUP} \
-b ${PKG_PREFIX} -u ${JB_USERID} ${JB_USER}
echo "Done."
fi
exit 0
|