Browse Source

Let ldapmodify and ldapadd use the same auth

I think this fixes https://github.com/osixia/docker-openldap/issues/139
asacamano 8 years ago
parent
commit
9cd74a6a23
1 changed files with 1 additions and 1 deletions
  1. 1 1
      image/service/slapd/startup.sh

+ 1 - 1
image/service/slapd/startup.sh

@@ -69,7 +69,7 @@ if [ ! -e "$FIRST_START_DONE" ]; then
     if grep -iq changetype $LDIF_FILE ; then
         ldapmodify -Y EXTERNAL -Q -H ldapi:/// -f $LDIF_FILE 2>&1 | log-helper debug || ldapmodify -h localhost -p 389 -D cn=admin,$LDAP_BASE_DN -w $LDAP_ADMIN_PASSWORD -f $LDIF_FILE 2>&1 | log-helper debug
     else
-        ldapadd -Y EXTERNAL -Q -H ldapi:/// -f $LDIF_FILE |& log-helper debug
+        ldapadd -Y EXTERNAL -Q -H ldapi:/// -f $LDIF_FILE |& log-helper debug || ldapadd -h localhost -p 389 -D cn=admin,$LDAP_BASE_DN -w $LDAP_ADMIN_PASSWORD -f $LDIF_FILE 2>&1 | log-helper debug
     fi
   }