freebsd-ports/net/openldap24-server/pkg-install
Edwin Groothuis e8643086f5 New ports: net/openldap23[-server, -client, -sasl-server, -sasl-server]
There is development version of openldap named 2.3.2beta2.
	These ports are based on http://people.freebsd.org/~eik/ports/openldap23.shar.
	The repocopy has been already made in ports/77170.

PR:		ports/80618
Submitted by:	Vsevolod Stakhov <vsevolod@highsecure.ru>
2005-05-05 00:53:44 +00:00

44 lines
1.4 KiB
Bash

#!/bin/sh
#
# $FreeBSD$
#
CHOWN=/usr/sbin/chown
ECHO_CMD=echo
GREP=/usr/bin/grep
PKG_INFO=/usr/sbin/pkg_info
PW=/usr/sbin/pw
FTPUSERS=/etc/ftpusers
case $2 in
PRE-INSTALL)
if ! ${PW} usershow -n ldap >/dev/null 2>&1; then
${ECHO_CMD}
if ! ${PW} groupshow -n ldap >/dev/null 2>&1; then
if ! ${PW} groupadd -n ldap -g 389; then
${ECHO_CMD} "*** Failed to add a group ldap with id 389."
${ECHO_CMD}
${ECHO_CMD} "Please add the ldap user manually with"
${ECHO_CMD} " ${PW} useradd -n ldap -g ldap -c 'OpenLDAP server' \\"
${ECHO_CMD} " -d /nonexistent -s /sbin/nologin -h -"
${ECHO_CMD} "and retry installing this package."
exit 1
fi
${ECHO_CMD} "===> Group 'ldap' created."
fi
if ! ${PW} useradd -n ldap -u 389 -g ldap -c 'OpenLDAP Server' \
-d /nonexistent -s /sbin/nologin -h -; then
${ECHO_CMD} "*** Failed to add an user ldap with id 389."
${ECHO_CMD}
${ECHO_CMD} "Please add the ldap user manually with"
${ECHO_CMD} " ${PW} useradd -n ldap -g ldap -c 'OpenLDAP server' \\"
${ECHO_CMD} " -d /nonexistent -s /sbin/nologin -h -"
${ECHO_CMD} "and retry installing this package."
exit 1
fi
${GREP} -qs '^ldap$' ${FTPUSERS} || ${ECHO_CMD} ldap >> ${FTPUSERS}
${ECHO_CMD} "===> Account 'ldap' created."
fi
;;
esac