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

support for init scripts added

parent 955254d1
......@@ -115,6 +115,22 @@ else
slapadd -n0 -F /etc/ldap/slapd.d -l "/etc/ldap/modules/${module}.ldif" >/dev/null 2>&1
done
fi
echo
if [ -s /docker-entrypoint-initdb.d/* ]; then
echo "running scripts from /docker-entrypoint-initdb.d/..."
for f in /docker-entrypoint-initdb.d/*; do
case "$f" in
# run any shell script found, as root
*.sh) echo "+-- $0: running $f"; . "$f" ;;
# run any LDIF scripts found, on the first database
*.ldif) echo "+-- $0: running $f"; slapadd -n1 -F /etc/ldap/slapd.d -l "$f" && echo ;;
# ignoring anything else
*) echo "+-- $0: ignoring $f" ;;
esac
echo
done
fi
chown -R openldap:openldap /etc/ldap/slapd.d/
......@@ -154,4 +170,4 @@ else
fi
# run the darn thing
exec "$@"
\ No newline at end of file
exec "$@"
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