aboutsummaryrefslogtreecommitdiffstats
path: root/irc/ptlink-ircd/pkg-install
blob: d837e4e6e30680e77b193fd7b7c3d59234ff6888 (plain) (blame)
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
#!/bin/sh
#
# $FreeBSD$
#

case $2 in
POST-INSTALL)
    USER=ircd
    GROUP=ircd
    UID=72
    GID=72

    if pw groupshow "${GROUP}" > /dev/null 2>&1; then
       echo "===> Using existing group ${GROUP}"
    else
       echo "===> Adding group ${GROUP}"
       pw groupadd ${GROUP} -g ${GID} || exit 1
    fi

    if pw usershow "${USER}" > /dev/null 2>&1; then
       echo "===> Using existing user ${USER}"
    else
       echo "===> Adding user ${USER}"
       pw adduser ${USER} -u ${UID} -g ${GROUP} -h - -d "/nonexistent" \
          -s "/nonexistent" -c "IRC daemon" || exit 1
    fi
    ;;
esac