Files
ports/net-im/openfire/pkg-install
T
Martin Wilke 7768099652 - Add GID and UID for net-im/openfire
- Bump PORTREVISION for new UID/GID

PR:		120882
Submitted by:	Nikolay Pavlov <qpadla@gmail.com> (maintainer)
2008-03-07 20:32:13 +00:00

35 lines
1.0 KiB
Bash

#!/bin/sh
case $2 in
POST-INSTALL)
PUSER=openfire
PGROUP=${PUSER}
PUID=342
PGID=${PUID}
if pw group show "${PGROUP}" >/dev/null; then
echo "You already have a group \"${PGROUP}\", so I will use it."
else
if pw groupadd ${PGROUP} -g ${PGID}; then
echo "Added group \"${PGROUP}\"."
else
echo "Adding group \"${PGROUP}\" failed..."
exit 1
fi
fi
if pw user show "${PUSER}" >/dev/null; then
echo "You already have a user \"${PUSER}\", so I will use it."
else
if pw useradd ${PUSER} -u ${PUID} -g ${PGROUP} -h - \
-d /nonexistent -s /sbin/nologin -c "Openfire Daemon"
then
echo "Added user \"${PUSER}\"."
else
echo "Adding user \"${PUSER}\" failed..."
exit 1
fi
fi
;;
esac