From: jkratoch <> Date: Thu, 22 Jul 2010 08:08:58 +0000 (+0000) Subject: Red Hat internal. X-Git-Url: https://git.jankratochvil.net/?p=nethome.git;a=commitdiff_plain;h=2b76fc7651a03f2acc36d5871e798223adf8cb09 Red Hat internal. --- diff --git a/bin/mutt_ldap_query b/bin/mutt_ldap_query new file mode 100755 index 0000000..d056b9d --- /dev/null +++ b/bin/mutt_ldap_query @@ -0,0 +1,21 @@ +#!/bin/bash + +# File: mutt_ldap_query +# +# Description: searches ldap for email addresses +# +# Author: Kiat Huang : 20041217 + +query=$1; + +#ldap_server="-h ldap.stuttgart.redhat.com" +ldap_server="-H ldap://127.0.0.1:3389" +search_base="dc=redhat,dc=com" + +echo +ldapsearch -x \ + -LLL \ + -b ${search_base} \ + ${ldap_server} \ + "(cn=*${query}*)" mail CommonName | awk -F: 'BEGIN { RS=""} {print $NF" <"$4">"}' \ + | sed 's/^[ ]*//;s/< /