#!/bin/bash
##########################################################
# (C) ZE CMS, Humboldt-Universitaet zu Berlin
# Written 2014 by Daniel Rohde <d.rohde@cms.hu-berlin.de>
##########################################################
# removes: 
#   LDAP user group 

if [ $# = 0 ] ; then
        echo "Usage: $0 group [group2 [group3 ...]]"
        exit 1
fi

. $(dirname $0)/config

while (( "$#" )) ; do
	group=$1
	ldapdelete -x -h $LDAP_HOST -D $LDAP_ADMIN -w $LDAP_ADMINPW <<EOF
cn=$group,$LDAP_GROUPS

EOF
	shift
done
