File tree Expand file tree Collapse file tree
opendj-packages/opendj-docker/bootstrap Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,18 +41,12 @@ echo "creating backend: $BACKEND_TYPE db-directory: ${BACKEND_DB_DIRECTORY}"
4141 --set enabled:true --no-prompt --trustAll
4242
4343if [ " $ADD_BASE_ENTRY " = " --addBaseEntry" ]; then
44-
45- DC=$( echo " $BASE_DN " | awk -F' ,|=' ' {print $2}' )
46-
47- /opt/opendj/bin/ldapmodify --hostname localhost \
48- --port 1636 --bindDN " $ROOT_USER_DN " --bindPassword " $ROOT_PASSWORD " \
49- --useSsl --trustAll << EOF
50- dn: $BASE_DN
51- dc: $DC
52- objectClass: domain
53- objectClass: top
54- EOF
55-
44+ echo " creating base entry..."
45+ BASE_TEMPLATE=$( mktemp)
46+ echo " branch: $BASE_DN " > $BASE_TEMPLATE
47+ /opt/opendj/bin/import-ldif --templateFile $BASE_TEMPLATE \
48+ --backendID=userRoot --bindDN " $ROOT_USER_DN " --bindPassword " $ROOT_PASSWORD "
49+ rm $BASE_TEMPLATE
5650fi
5751
5852
You can’t perform that action at this time.
0 commit comments