Commit db6f2828 authored by Michał 'rysiek' Woźniak's avatar Michał 'rysiek' Woźniak
Browse files

SLAPD_* vars now used to replace things in /docker-entrypoint-initdb.d/*.ldif files

parent d0dfe90d
......@@ -180,9 +180,24 @@ else
for f in /docker-entrypoint-initdb.d/*; do
case "$f" in
# run any shell script found, as root
*.sh) echo "+-- $0: running $f"; . "$f" ;;
echo "+-- $0: running $f";
. "$f"
# run any LDIF scripts found, on the first database
*.ldif) echo "+-- $0: running $f"; ldapadd -H ldapi://%2fvar%2frun%2fldap%2fldapi -x -D "cn=admin,$SLAPD_DOMAINDN" -w "$SLAPD_PASSWORD" -f "$f" && echo ;;
echo "+-- $0: running $f";
nf="$( mktemp )";
cp "$f" "$nf";
SLAPD_ROOTDC="$( echo $SLAPD_DOMAIN | cut -d '.' -f 1 )";
sed -i "s/#SLAPD_ROOTDC#/$SLAPD_ROOTDC/" "$nf";
ldapadd -H ldapi://%2fvar%2frun%2fldap%2fldapi -x -D "cn=admin,$SLAPD_DOMAINDN" -w "$SLAPD_PASSWORD" -f "$nf";
rm "$nf";
# ignoring anything else
*) echo "+-- $0: ignoring $f" ;;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment