mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-28 01:06:17 +00:00
6a97464491
- Fix some errors on user/group creation phase [2] PR: 123124 [1] 122914 [2] Submitted by: Linh Pham <question+fbsdports@closedsrc.org> [1] Nikolay Pavlov <qpadla@gmail.com> [2] (maintainer) Approved by: maintainer
31 lines
890 B
Bash
31 lines
890 B
Bash
#!/bin/sh
|
|
|
|
case $2 in
|
|
POST-INSTALL)
|
|
PUSER=openfire
|
|
PGROUP=${PUSER}
|
|
PUID=342
|
|
PGID=${PUID}
|
|
|
|
if ! pw group show "${PGROUP}" > /dev/null; then
|
|
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
|
|
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
|