1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-02 01:20:54 +00:00
freebsd-ports/databases/couchdb/pkg-install
Wesley Shields 7622f83fd1 - Add an RC script.
- Cleanup messasges displayed by the port.
- Add a couchdb user and group.

PR:		ports/135256, ports/135259
Submitted by:	Till Klampaeckel <till@php.net> (maintainer)
2009-06-17 14:10:30 +00:00

33 lines
649 B
Bash

#!/bin/sh
PATH=/bin:/usr/sbin
USER=couchdb
GROUP=couchdb
UID=919
GID=919
case $2 in
PRE-INSTALL)
if pw user show "${USER}" 2>/dev/null; then
echo "You already have a user \"${USER}\", so I will use it."
else
if pw groupadd ${GROUP} -g ${GID}
then
echo "Added group \"${GROUP}\"."
else
echo "Adding group \"${GROUP}\" failed..."
exit 1
fi
if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
-s /usr/sbin/nologin -L daemon -d /var/empty -c "CouchDB Account"
then
echo "Added user \"${USER}\"."
else
echo "Adding user \"${USER}\" failed..."
exit 1
fi
fi
;;
esac