diff --git a/setup/ldap.sh b/setup/ldap.sh index 0d52aded..78e2c4cb 100755 --- a/setup/ldap.sh +++ b/setup/ldap.sh @@ -71,42 +71,46 @@ wait_slapd_start() { say_verbose "...ok" } +_add_if_missing() { + local var="$1" + local val="$2" + local conf="$MIAB_INTERNAL_CONF_FILE" + if [ $(grep -c "^${var}=" "$conf") -eq 0 ]; then + echo "${var}=\"${val}\"" >> "$conf" + fi +} + create_miab_conf() { # create (if non-existing) or load (existing) ldap/miab_ldap.conf if [ ! -e "$MIAB_INTERNAL_CONF_FILE" ]; then say_verbose "Generating a new $MIAB_INTERNAL_CONF_FILE" mkdir -p "$(dirname $MIAB_INTERNAL_CONF_FILE)" - - # Use 64-character secret keys of safe characters - cat > "$MIAB_INTERNAL_CONF_FILE" <>"$MIAB_INTERNAL_CONF_FILE" <