#!/bin/bash

#move conf
cp slapd.conf ./slapd/
cd slapd
#empty db
/bin/rm db/*
#setup DB_CONFIG
cp ./DB_CONFIG ./db/

#regenate db index, ..
slapd  -f ./slapd.conf  -h ldap://hpc01:2$UID & PID=$!
sleep 3
kill $PID
#clean slapd conf
/bin/rm -R slapd.d/*

#create slapd new conf
slaptest -f ./slapd.conf -F ./slapd.d/
cd ..
