aboutsummaryrefslogtreecommitdiff
path: root/net/activemq/pkg-install
blob: ec5c306236cc6f053cd098edb994c0c13f9f9fa1 (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
29
30
#!/bin/sh

case $2 in
POST-INSTALL)
        MQUSER=activemq
        MQGROUP=${MQUSER}
        MQUID=929
        MQGID=${MQUID}

        if ! pw group show "${MQGROUP}" > /dev/null; then
                if pw groupadd ${MQGROUP} -g ${MQGID}; then
                        echo "Added group \"${MQGROUP}\"."
                else
                        echo "Adding group \"${MQGROUP}\" failed..."
                        exit 1
                fi
        fi

        if ! pw user show "${MQUSER}" > /dev/null; then
                if pw useradd ${MQUSER} -u ${MQUID} -g ${MQGROUP} -h - \
                        -d /nonexistent -s /sbin/nologin -c "ActiveMQ Daemon"
                then
                        echo "Added user \"${MQUSER}\"."
                else
                        echo "Adding user \"${MQUSER}\" failed..."
                        exit 1
                fi
        fi
        ;;
esac