1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-21 04:06:46 +00:00
freebsd-ports/net/openldap22-server/pkg-install
Oliver Eikemeier 47acbb6df7 update to 2.2.15
- new switch WITH_DYNAMIC_BACKENDS
- WITH_ODBC has to be specified, even when WITH_ODBC_TYPE is set
- 5.x users: when you need to start the daemon early, build with
  WITH_RCORDER=yes to put the start script into /etc/rc.d
2004-08-15 18:18:46 +00:00

45 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