#!/bin/sh # # Program: Index an openldap server # # Author: Matty < matty91 at gmail dot com > # # Current Version: 1.0 # # Revision History: # # Version 1.0 # Initial Release # # Last Updated: 01-06-2007 # # Purpose: # This program can be used to index teh entries in an openldap # server. # # License: # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Installation: # Copy the shell script to a suitable location PATH=/bin:/usr/bin:/usr/local/bin:/usr/sfw/bin export PATH # Global variables DATE=`date "+%Y%m%d"` BASE="dc=prefetch,dc=net" CONFIG="/etc/openldap/slapd.conf" # Parse the options that are passed to the script while getopts b:c: option do case "${option}" in b) BASE=${OPTARG} ;; c) CONFIG=${OPTARG} ;; \?) usage exit 1;; esac done if [ -f ${CONFIG} ] then slapindex -f ${CONFIG} -b ${BASE} else echo "Configuration file ${CONFIG} does not exist" exit 1 fi