blob: 53a5e5ffeafa33390dacfb820f94897f62c7f8a1 (
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
|
#!/bin/sh
#
# $NetBSD: INSTALL,v 1.1 2001/10/31 20:06:32 zuntum Exp $
PKGNAME=$1
STAGE=$2
USER=@USER@
GROUP=@GROUP@
ADDUSER=@ADDUSER@
ADDGROUP=@ADDGROUP@
CHGRP="@CHGRP@"
ID="@ID@"
RM="@RM@"
TOUCH="@TOUCH@"
case ${STAGE} in
PRE-INSTALL)
${TOUCH} "/tmp/grouptestirc.$$"
${CHGRP} ${GROUP} "/tmp/grouptestirc.$$" >/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/grouptestirc.$$"
${ID} ${USER} >/dev/null 2>&1
if [ $? -eq 0 ]; then
echo "User '${USER}' already exists...proceeding."
else
echo "Creating '${USER}' user..."
${ADDUSER} -c "IRC User" -g ${GROUP} -s /sbin/nologin ${USER}
echo "Done."
fi
;;
POST-INSTALL)
:;;
*)
echo "Unexpected argument: ${STAGE}"
exit 1
;;
esac
exit 0
|