if test $# -ge 1 ; then
SRCDIR=$1; shift
fi
-BACKEND=bdb
-if test $# -ge 1 ; then
- BACKEND=$1; shift
-fi
-WAIT=0
-if test $# -ge 1 ; then
- WAIT=1; shift
-fi
+
+. $SRCDIR/scripts/args.sh
echo "running defines.sh"
. $SRCDIR/scripts/defines.sh
rm -f $DBDIR/[!C]* $DBDIR/C_db?/*
echo "Running slapadd to build glued slapd databases..."
-. $CONFFILTER $BACKEND < $GLUECONF > $DBCONF
+. $CONFFILTER $BACKEND $MONITORDB < $GLUECONF > $DBCONF
$SLAPADD -d $LVL -f $DBCONF -l $LDIFORDERED > $DBDIR/slapadd.log 2>&1
RC=$?
if test $RC != 0 ; then
for i in 0 1 2 3 4 5; do
../$LDAPSEARCH -b "$BASEDN" -h $LOCALHOST -p $PORT > ../$SEARCHOUT 2>&1
RC=$?
- if test $RC = 1 ; then
- echo "Waiting 5 seconds for slapd to start..."
- sleep 5
+ if test $RC = 0 ; then
+ break
fi
+ echo "Waiting 5 seconds for slapd to start..."
+ sleep 5
done
cd ..
$LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
'objectclass=*' > /dev/null 2>&1
RC=$?
- if test $RC = 1 ; then
- echo "Waiting 5 seconds for slapd to start..."
- sleep 5
+ if test $RC = 0 ; then
+ break
fi
+ echo "Waiting 5 seconds for slapd to start..."
+ sleep 5
done
echo "Using ldapadd to populate the glued database..."