#!/bin/ksh
#
#####
#####  Build ldap directory.
#####

#####
#####  First convert the file to ldif format for import
#####    I assume that the admin bin directory is /var/adm/bin
#####
/var/adm/bin/ldap_convert.sh > ./ldif_input_file.txt                  

#####
#####  Next import the database
#####
ldif2ldbm -i ./ldif_input_file.txt -f ./slapd.conf    

#####
#####  Now rebuild the indexes
#####
ldif2index -i ./ldif_input_file.txt -f ./slapd.conf   

#####
#####  Then echo the database in new indexed format to screen
#####
ldbmcat /var/ldap/databases/`basename \`pwd\``/id2entry.dbb | more

