This commit is contained in:
paul 2019-04-18 21:00:07 +02:00
parent c79c8bffd7
commit 5c77c97954

View file

@ -6,12 +6,12 @@ CONFDIR=${CONFDIR:-'/etc/ldap/slapd.d'}
DATADIR=${DATADIR:-'/var/lib/ldap'} DATADIR=${DATADIR:-'/var/lib/ldap'}
if [[ -z "$ORGANIZATION" && -z "$SUFFIX" ]] ; then if [[ -z "$ORGANIZATION" && -z "$SUFFIX" ]] ; then
fail 'neither ORGANIZATION nor SUFFIX supplied as environment var' fail 'neither ORGANIZATION nor SUFFIX supplied as environment var'
fi fi
if [[ -n "$ORGANIZATION" ]] ; then if [[ -n "$ORGANIZATION" ]] ; then
# if an organization was set, we can generate the RootDN from that # if an organization was set, we can generate the RootDN from that
SUFFIX=${SUFFIX:-"o=${ORGANIZATION}"} SUFFIX=${SUFFIX:-"o=${ORGANIZATION}"}
fi fi
function fail { function fail {
@ -32,11 +32,13 @@ function configure {
} }
function init_fixtures { function init_fixtures {
mkdir -p /docker-entrypoint-initdb.d mkdir -p /docker-entrypoint-initdb.d
# if no files exist in this directory then copy example structure # if no files exist in this directory then copy example structure
if ! ls /docker-entrypoint-initdb.d/* 1> /dev/null 2>&1 ; then if ! ls /docker-entrypoint-initdb.d/* 1> /dev/null 2>&1 ; then
cp /usr/share/slapd/fixtures/example_structure.ldif /docker-entrypoint-initdb.d/structure.ldif cp \
fi /usr/share/slapd/fixtures/example_structure.ldif \
/docker-entrypoint-initdb.d/
fi
for f in /docker-entrypoint-initdb.d/*; do for f in /docker-entrypoint-initdb.d/*; do