#!/usr/bin/ksh #---------#---------#---------#---------#---------#---------#---------#--------- # Title: delete entries in an LDAP database using iplanet ldapdelete utility # Date: 05 Oct 00 # Author: larg # Description: # Takes a distinguished name. # Connects to the directory server using details from the configuration # file $LDAP_CONF. # Deletes the entry that the name matches. # The entry must be at the end of a branch. # You cannot delete entries at branch points. # The script has to use a korn shell because of followed links # Modifications: # #---------#---------#---------#---------#---------#---------#---------#--------- LDAP_CONF=ldap_config.conf # check command line options if [ $# -lt 1 ] then echo "Usage: $0 distinguished-name" echo "" echo "Example:" echo " $0 \"cn=nick@visp.com, ou=MAIL, o=isp01\" " echo "" exit 1 fi # set up the environment if [ ! -f $LDAP_CONF ] then echo "Can't open the configuration file: $LDAP_CONF" exit 2 fi . ./$LDAP_CONF export LD_LIBRARY_PATH=$LDAP_HOME/lib # run the command echo "using this command: " echo "$LDAP_HOME/shared/bin/ldapdelete -v -D \"$LDAP_AUTH\" -w \"$LDAP_PASS\" -h $LDAP_HOST \"$1\" " echo " " $LDAP_HOME/shared/bin/ldapdelete -v -D "$LDAP_AUTH" -w "$LDAP_PASS" -h $LDAP_HOST "$1" echo " "