#! /bin/sh

OPTIONS=
SLAPD_OPTIONS=
SLAPD_HOSTS=
SLAPD_USER=ldap
test -r /etc/sysconfig/ldap && . -r /etc/sysconfig/ldap

if test -z "$SLAPD_HOSTS"; then
    grep -q ^TLS /etc/openldap/slapd.conf &&
	SLAPD_HOSTS="ldap:/// ldaps:///" ||
	SLAPD_HOSTS="ldap:///"
fi

exec /usr/sbin/slapd -uldap -h "$SLAPD_HOSTS" -l daemon $OPTIONS $SLAPD_OPTIONS "$@" -d0
