2001-05-12 08:51:28 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
SRCDIR="../../../.."
|
|
|
|
METADBDIR="./meta-db"
|
|
|
|
SLAPADD="$SRCDIR/servers/slapd/tools/slapadd -v"
|
|
|
|
|
2001-05-14 01:58:03 +08:00
|
|
|
#ADDCONF="./slapd-meta-plain.conf"
|
|
|
|
ADDCONF="./slapd-meta-rewrite.conf"
|
2001-05-12 08:51:28 +08:00
|
|
|
#ADDCONF="./slapd-ldap-rewrite.conf"
|
|
|
|
|
|
|
|
LDAPADDCONF="./slapd-ldap-raw.conf"
|
|
|
|
CONF="./slapd.conf"
|
|
|
|
LDAPCONF="./slapd-ldap.conf"
|
|
|
|
PORT=9876
|
|
|
|
#DEBUG=-1
|
|
|
|
DEBUG=0
|
|
|
|
|
|
|
|
rm -rf $METADBDIR
|
|
|
|
rm -f schema ucdata
|
2001-05-14 01:58:03 +08:00
|
|
|
|
|
|
|
sed "s/@PORT@/$PORT/" $ADDCONF > $CONF
|
|
|
|
sed "s/@PORT@/$PORT/" $LDAPADDCONF > $LDAPCONF
|
|
|
|
|
2001-05-12 08:51:28 +08:00
|
|
|
ln -s "$SRCDIR/servers/slapd/schema" .
|
|
|
|
ln -s "$SRCDIR/libraries/liblunicode" ucdata
|
2001-05-14 01:58:03 +08:00
|
|
|
|
2001-05-12 08:51:28 +08:00
|
|
|
for i in 1 2 3 ; do
|
|
|
|
echo "Feeding directory $i"
|
|
|
|
mkdir -p "$METADBDIR/$i"
|
2001-12-27 20:17:54 +08:00
|
|
|
$SLAPADD -f $ADDCONF -n `expr $i + 1` -l meta-$i.ldif
|
2001-05-12 08:51:28 +08:00
|
|
|
done
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "After slapd started, try"
|
|
|
|
echo ""
|
2001-10-21 01:19:56 +08:00
|
|
|
echo " ldapsearch -x -H ldap://:$PORT/ -b '' -s base namingContexts"
|
2001-05-12 08:51:28 +08:00
|
|
|
echo ""
|
|
|
|
echo "and browse the directory using the last base that appears;"
|
|
|
|
echo "you may also try to bind as administrator of each subdirectory"
|
|
|
|
echo "or as \"cn=Ando, ...\" with password \"ando\": notice what happens"
|
|
|
|
echo "to attrs \"sn\" and \"cn\" of some entries based on the ACLs ..."
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
echo "Starting slapd on port $PORT"
|
2001-10-21 01:19:56 +08:00
|
|
|
$SRCDIR/servers/slapd/slapd -f $CONF -h "ldap://:$PORT/" -d $DEBUG
|
2001-05-12 08:51:28 +08:00
|
|
|
echo "Waiting 2 secs for everything to shut down ..."
|
|
|
|
sleep 2
|
|
|
|
|
|
|
|
#exit
|
|
|
|
|
|
|
|
rm -rf $METADBDIR
|
|
|
|
rm -f schema ucdata $CONF $LDAPCONF
|
|
|
|
|