split generation/addition of schemas and importing of LDIF files from generation of default LDAP tree when LDAP_SKIP_DEFAULT_TREE is set to yes

Signed-off-by: Johannes Kastl <kastl@b1-systems.de>
This commit is contained in:
Johannes Kastl
2022-03-25 20:59:45 +01:00
parent 47e22c9714
commit 803db5a114
2 changed files with 20 additions and 24 deletions

View File

@@ -464,19 +464,17 @@ ldap_initialize() {
if is_boolean_yes "$LDAP_ENABLE_TLS"; then
ldap_configure_tls
fi
if is_boolean_yes "$LDAP_SKIP_DEFAULT_TREE"; then
info "Skipping default schemas/tree structure"
# Initialize OpenLDAP with schemas/tree structure
ldap_add_schemas
if [[ -f "$LDAP_CUSTOM_SCHEMA_FILE" ]]; then
ldap_add_custom_schema
fi
if ! is_dir_empty "$LDAP_CUSTOM_LDIF_DIR"; then
ldap_add_custom_ldifs
elif is_boolean_no "$LDAP_SKIP_DEFAULT_TREE"; then
ldap_create_tree
else
# Initialize OpenLDAP with schemas/tree structure
ldap_add_schemas
if [[ -f "$LDAP_CUSTOM_SCHEMA_FILE" ]]; then
ldap_add_custom_schema
fi
if ! is_dir_empty "$LDAP_CUSTOM_LDIF_DIR"; then
ldap_add_custom_ldifs
else
ldap_create_tree
fi
info "Skipping default schemas/tree structure"
fi
ldap_stop
fi

View File

@@ -464,19 +464,17 @@ ldap_initialize() {
if is_boolean_yes "$LDAP_ENABLE_TLS"; then
ldap_configure_tls
fi
if is_boolean_yes "$LDAP_SKIP_DEFAULT_TREE"; then
info "Skipping default schemas/tree structure"
# Initialize OpenLDAP with schemas/tree structure
ldap_add_schemas
if [[ -f "$LDAP_CUSTOM_SCHEMA_FILE" ]]; then
ldap_add_custom_schema
fi
if ! is_dir_empty "$LDAP_CUSTOM_LDIF_DIR"; then
ldap_add_custom_ldifs
elif is_boolean_no "$LDAP_SKIP_DEFAULT_TREE"; then
ldap_create_tree
else
# Initialize OpenLDAP with schemas/tree structure
ldap_add_schemas
if [[ -f "$LDAP_CUSTOM_SCHEMA_FILE" ]]; then
ldap_add_custom_schema
fi
if ! is_dir_empty "$LDAP_CUSTOM_LDIF_DIR"; then
ldap_add_custom_ldifs
else
ldap_create_tree
fi
info "Skipping default schemas/tree structure"
fi
ldap_stop
fi