#!/bin/bash LDAP_USER=openldap LDAP_CONF=/etc/ldap ## stop the default service echo "Stopping slapd" /etc/init.d/slapd stop ## start, using slapd.conf file echo "Generating ldif config using: ${LDAP_CONF}/slapd.conf" #slapd -h 'ldap:/// ldapi:///' -g ${LDAP_USER} -u ${LDAP_USER} -f /etc/ldap/slapd.conf rm -rf /etc/ldap/slapd.d/* slaptest -f /etc/ldap/slapd.conf -F /etc/ldap/slapd.d chown -R ${LDAP_USER}.${LDAP_USER} /etc/ldap/slapd.d echo "Starting slapd" /etc/init.d/slapd start ## End of Script