From 6cf71210f71c18635d764533154fa637fe49d50c Mon Sep 17 00:00:00 2001 From: Juan Gomez Date: Wed, 12 May 1999 03:22:48 +0000 Subject: [PATCH] Script that starts a server with NIS schema and sample database. --- tests/scripts/startup_nis_ldap_server.sh | 43 ++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 tests/scripts/startup_nis_ldap_server.sh diff --git a/tests/scripts/startup_nis_ldap_server.sh b/tests/scripts/startup_nis_ldap_server.sh new file mode 100755 index 0000000000..d7aef436e3 --- /dev/null +++ b/tests/scripts/startup_nis_ldap_server.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +if [ $# -eq 0 ]; then + SRCDIR="." +else + SRCDIR=$1; shift +fi +if [ $# -eq 1 ]; then + BDB2=$1; shift +fi + +. $SRCDIR/scripts/defines.sh $SRCDIR $BDB2 + +# Sample NIS database in LDIF format +NIS_LDIF=$SRCDIR/../schema/nis_sample.ldif + +# Sample configuration file for your LDAP server +if test "$BACKEND" = "bdb2" ; then + NIS_CONF=$DATADIR/slapd-bdb2-nis-master.conf +else + NIS_CONF=$DATADIR/slapd-nis-master.conf +fi + +echo "Cleaning up in $DBDIR..." + +rm -f $DBDIR/[!C]* + +echo "Running ldif2ldbm to build slapd database..." +$LDIF2LDBM -f $NIS_CONF -i $NIS_LDIF -e ../servers/slapd/tools +RC=$? +if [ $RC != 0 ]; then + echo "ldif2ldbm failed!" + exit $RC +fi + +echo "Starting slapd on TCP/IP port $PORT..." +$SLAPD -f $NIS_CONF -p $PORT -d $LVL $TIMING > $MASTERLOG 2>&1 & +PID=$! + +echo ">>>>> LDAP server with NIS schema is up! PID=$PID" + + +exit 0 -- 2.39.5