Substitutes Base DN in custom ldif files

This commit is contained in:
Dmitry Melanchenko
2016-02-14 03:58:36 -05:00
parent d619bd5109
commit d1439cdd2f
+1
View File
@@ -192,6 +192,7 @@ EOF
log-helper info "Add bootstrap ldif..."
for f in $(find ${CONTAINER_SERVICE_DIR}/slapd/assets/config/bootstrap/ldif -mindepth 1 -maxdepth 1 -type f -name \*.ldif | sort); do
log-helper debug "Processing file ${f}"
sed -i "s|{{ LDAP_BASE_DN }}|${LDAP_BASE_DN}|g" $f
ldapmodify -Y EXTERNAL -Q -H ldapi:/// -f $f 2>&1 | log-helper debug || ldapmodify -h localhost -p 389 -D cn=admin,$LDAP_BASE_DN -w $LDAP_ADMIN_PASSWORD -f $f 2>&1 | log-helper debug
done