]> git.sur5r.net Git - openldap/blob - tests/scripts/start-server2
1c8b195598e716acab344734c8332d8ee8e7bd50
[openldap] / tests / scripts / start-server2
1 #! /bin/sh
2 # $OpenLDAP$
3
4 echo "running defines.sh"
5 . $SRCDIR/scripts/defines.sh
6
7 mkdir -p $TESTDIR $DBDIR2
8
9 echo "Starting slapd on TCP/IP port $PORT2..."
10 . $CONFFILTER $BACKEND < $CONFTWO > $CONF2
11 $SLAPD -f $CONF2 -h $URI2 -d $LVL $TIMING > $LOG2 2>&1 &
12 PID=$!
13
14 echo "Using ldapsearch to retrieve all the entries..."
15 for i in 0 1 2 3 4 5; do
16         $LDAPSEARCH -S "" -b "" -s base -h $LOCALHOST -p $PORT2 > $SERVER2OUT 2>&1
17         RC=$?
18         if test $RC = 1 ; then
19                 echo "Waiting 5 seconds for slapd to start..."
20                 sleep 5
21         fi
22 done
23
24 if test $RC != 0 ; then
25         echo "ldapsearch failed ($RC)!"
26         exit $RC
27 fi
28
29 echo ">>>>> Server2 (pid=$PID) started"
30 exit 0