Expand PMF_FN_* macros.
[netbsd-mini2440.git] / crypto / dist / heimdal / tests / ldap / slapd-init.in
blob1edf3f37e45277fbb8ab80967cb6227f18f61045
1 #!/bin/sh
2 # $Heimdal: slapd-init.in 22295 2007-12-14 05:59:04Z lha $
3 # $NetBSD$
5 srcdir=@srcdir@
7 rm -rf db schema
8 mkdir db
10 # kill of old slapd if running
11 sh ${srcdir}/slapd-stop > /dev/null
13 SCHEMA_NEEDED="hdb core nis cosine inetorgperson openldap samba"
15 SCHEMA_PATHS="${srcdir}/../../lib/hdb ${srcdir} /etc/ldap/schema /etc/openldap/schema /private/etc/openldap/schema /usr/share/openldap/schema"
17 test -d schema || mkdir schema
19 # setup needed schema files
20 for f in $SCHEMA_NEEDED; do
21 if [ ! -r schema/$f.schema ]; then
22 for d in $SCHEMA_PATHS ; do
23 if [ -r $d/$f.schema ] ; then
24 cp $d/$f.schema schema/$f.schema
25 continue 2
27 done
28 echo "SKIPPING TESTS: you need the following schema file: $f.schema"
29 exit 1
31 done
33 touch modules.conf || exit 1
35 slapadd -d 0 -f ${srcdir}/slapd.conf < ${srcdir}/init.ldif || exit 0
37 echo "starting slapd"
38 slapd -d0 -f ${srcdir}/slapd.conf -h ldapi://.%2Fldap-socket &
40 sleep 4