#!/bin/sh
#
# Script to remove duplicate entries in acl database

/opt/lanman/sbin/acladm -E |sort |uniq -c |while read line
do
    # get the count from the first field
    # then shift it out to get back the original line without count

    set $line
    count=$1
    shift

    while [ $count -gt 1 ]
    do
	echo "deleting duplicate acl for $*"
	/opt/lanman/sbin/rmacl -f $*
	count=`expr $count - 1`
    done
done
