File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -40,13 +40,17 @@ load_initial_data() {
40
40
local data=$(find ${DATA_DIR} -maxdepth 1 -name \*_\*.ldif -type f | sort)
41
41
for ldif in ${data}; do
42
42
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}"
46
48
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}"
50
54
fi
51
55
52
56
ldapadd -x -H ldapi:/// \
You can’t perform that action at this time.
0 commit comments