#!/bin/bash
# Samba-TNG                                     list_unixgroup_members
# --------------------------------------------------------------------

# --------------------------------------------------------------------
# config here

. ./prefs

# --------------------------------------------------------------------
# print usage

if [ "$1" == "" ]; then 
	echo "Usage: $(basename $0) <group>"
	exit 0
fi

groupexist=`getent group|grep -w "$1"`

if [ -z "$groupexist" ]; then
        echo "Group does not exist!"
        exit 1
fi

# --------------------------------------------------------------------
# begin

$ldapsearch -D $binddn -w $bindpassword -b $groupsuffix cn="$1" -LLL|grep memberUid|awk '{print $2}'|less

exit 0

# --------------------------------------------------------------------
