Skip to content

Commit c530409

Browse files
authored
Merge pull request #50 from IngmarPaetzold/master
Fix for issues #42, #49
2 parents 080e00d + 90584b4 commit c530409

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

rootfs/etc/cont-init.d/050-openldap-populate

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,17 @@ load_initial_data() {
4040
local data=$(find ${DATA_DIR} -maxdepth 1 -name \*_\*.ldif -type f | sort)
4141
for ldif in ${data}; do
4242
echo "Processing file ${ldif}..."
43-
if [ ! -z "$LDAP_BASEDN" ]; then
44-
echo "updating base dn dc=planetexpress,dc=com -> ${LDAP_BASEDN}"
45-
sed -i "s/dc=planetexpress,dc=com/${LDAP_BASEDN}/g" "${ldif}"
43+
44+
base_dn=${LDAP_BASEDN:-}
45+
if [ ! -z "${base_dn}" ]; then
46+
echo "updating base dn dc=planetexpress,dc=com -> ${base_dn}"
47+
sed -i "s/dc=planetexpress,dc=com/${base_dn}/g" "${ldif}"
4648
fi
47-
if [ "$LDAP_DOMAIN" != "planetexpress.com" ]; then
48-
echo "updating emails @planetexpress.com -> @${LDAP_DOMAIN}"
49-
sed -i "s/@planetexpress.com/@${LDAP_DOMAIN}/g" "${ldif}"
49+
50+
domain=${LDAP_DOMAIN:-}
51+
if [ "${domain}" != "planetexpress.com" ]; then
52+
echo "updating emails @planetexpress.com -> @${domain}"
53+
sed -i "s/@planetexpress.com/@${domain}/g" "${ldif}"
5054
fi
5155

5256
ldapadd -x -H ldapi:/// \

rootfs/opt/openldap/bootstrap/config/tls.ldif

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
dn: cn=config
22
changetype: modify
3-
replace: olcTLSCACertificateFile
4-
olcTLSCACertificateFile: /etc/ldap/ssl/fullchain.crt
5-
-
63
replace: olcTLSCertificateFile
74
olcTLSCertificateFile: /etc/ldap/ssl/ldap.crt
85
-

0 commit comments

Comments
 (0)