#!/bin/bash

# slap* needs schema information, which is later fetched by replication.py
fake_initial_schema () {
        [ "$ldap_server_type" = master ] && return
        [ -s /var/lib/univention-ldap/schema.conf ] && return
        local tmp=$(mktemp)
        printf '# univention_dummy.conf\n\nldap/server/type: master' >"$tmp"
        UNIVENTION_BASECONF="$tmp" univention-config-registry filter \
                </etc/univention/templates/files/etc/ldap/slapd.conf.d/10univention-ldap-server_schema \
                >/var/lib/univention-ldap/schema.conf
        rm -f "$tmp"
}
fake_initial_schema
