diff options
Diffstat (limited to 'crypto/heimdal/tests/ldap/slapd-init.in')
-rw-r--r-- | crypto/heimdal/tests/ldap/slapd-init.in | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/crypto/heimdal/tests/ldap/slapd-init.in b/crypto/heimdal/tests/ldap/slapd-init.in new file mode 100644 index 0000000..e411808 --- /dev/null +++ b/crypto/heimdal/tests/ldap/slapd-init.in @@ -0,0 +1,39 @@ +#!/bin/sh +# $Id: slapd-init.in 22295 2007-12-14 05:59:04Z lha $ + +srcdir=@srcdir@ + +rm -rf db schema +mkdir db + +# kill of old slapd if running +sh ${srcdir}/slapd-stop > /dev/null + +SCHEMA_NEEDED="hdb core nis cosine inetorgperson openldap samba" + +SCHEMA_PATHS="${srcdir}/../../lib/hdb ${srcdir} /etc/ldap/schema /etc/openldap/schema /private/etc/openldap/schema /usr/share/openldap/schema" + +test -d schema || mkdir schema + +# setup needed schema files +for f in $SCHEMA_NEEDED; do + if [ ! -r schema/$f.schema ]; then + for d in $SCHEMA_PATHS ; do + if [ -r $d/$f.schema ] ; then + cp $d/$f.schema schema/$f.schema + continue 2 + fi + done + echo "SKIPPING TESTS: you need the following schema file: $f.schema" + exit 1 + fi +done + +touch modules.conf || exit 1 + +slapadd -d 0 -f ${srcdir}/slapd.conf < ${srcdir}/init.ldif || exit 0 + +echo "starting slapd" +slapd -d0 -f ${srcdir}/slapd.conf -h ldapi://.%2Fldap-socket & + +sleep 4 |