X-Git-Url: https://git.jankratochvil.net/?p=nethome.git;a=blobdiff_plain;f=bin%2Fmutt_ldap_query;fp=bin%2Fmutt_ldap_query;h=d056b9d35533d2ccfb71c465f4240fca73e91f4d;hp=0000000000000000000000000000000000000000;hb=2b76fc7651a03f2acc36d5871e798223adf8cb09;hpb=d5e6966219376a6704589bf4bfc3f9496bff4ff4 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/< /