ninedocker/services/30-openldap/volume/nine/init.sh

19 lines
598 B
Bash
Raw Normal View History

2024-07-04 12:42:13 +02:00
#!/bin/bash
if [[ ! -f /bitnami/openldap/.isinit ]]
then
echo ""
echo "Initialisation annuaire"
echo ""
# Suppression de l'entrée users généré automatiquement par l'image docker bitnami/openldap
ldapdelete ou=users,${LDAP_BASEDN} -r -H ldap://${LDAP_HOST}:${LDAP_PORT} -D ${LDAP_USER} -w ${LDAP_PASSWORD} 2>/dev/null
# Integration du ldif de base
ldapadd -H ldap://${LDAP_HOST}:${LDAP_PORT} -D ${LDAP_USER} -w ${LDAP_PASSWORD} -f '/nine/ldif/cadoles.ldif' 2>/dev/null
/nine/changepassword.sh admin ${ADMIN_PASSWORD}
touch /bitnami/openldap/.isinit
fi