#!/bin/sh
#
# show-saslmechs
#
# Lists the SASL mechanisms supported by the DSA
#
# andrew.findlay@skills-1st.co.uk
#
# $Id$

PROG=`basename "$0"`

# Find the vars file for this example
# The working directory must be in the example subtree

if test -f ../vars
then
	. ../vars
elif test -f vars
then
	. ./vars
else
	echo "$PROG: no vars file in . or .." 1>&2
	exit 1
fi

if test -z "${servername}" -o -z "${serverport}"
then
	echo "$PROG: must define servername and serverport in the vars file" 1>&2
	exit 1
fi


echo Without TLS:
ldapsearch -LLL \
	-H "ldap://${servername}:${serverport}/" \
	-s base \
	-b '' \
	-x 'objectclass=*' supportedSASLMechanisms

echo With TLS:
ldapsearch -LLL \
	-ZZ \
	-H "ldap://${servername}:${serverport}/" \
	-s base \
	-b '' \
	-x 'objectclass=*' supportedSASLMechanisms

