From 88fbcb52dd2c5cdfc32467914c774a67481a3f00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Luginb=C3=BChl?= Date: Sun, 20 Dec 2015 15:59:32 +0100 Subject: [PATCH] Added functionality to reconfigure a previously configured container --- README.md | 7 ++++++- entrypoint.sh | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cc60067..bd27167 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,12 @@ a corresponsing name from the `module` directory. Currently only `memberof` is avaliable. After the first start of the image (and the initial configuration), these -envirnonment variables are not evaluated anymore. +envirnonment variables are not evaluated anymore. If one needs to reconfigure +the `slapd` service, it is possible to set + + SLAPD_FORCE_RECONFIGURE (defaults to false) + +to `true`. Data persistence ---------------- diff --git a/entrypoint.sh b/entrypoint.sh index 8454db8..3223edd 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -9,7 +9,9 @@ set -e chown -R openldap:openldap /var/lib/ldap/ /var/run/slapd/ -if [[ ! -d /etc/ldap/slapd.d ]]; then +SLAPD_FORCE_RECONFIGURE="${SLAPD_FORCE_RECONFIGURE:-false}" + +if [[ ! -d /etc/ldap/slapd.d || "$SLAPD_FORCE_RECONFIGURE" == "true" ]]; then if [[ -z "$SLAPD_PASSWORD" ]]; then echo -n >&2 "Error: Container not configured and SLAPD_PASSWORD not set. "