Projects
Eulaceura:Factory
mutt
_service:obs_scm:mutt_ldap_query
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:mutt_ldap_query of Package mutt
#!/bin/sh # # Last modified: 30 October 2000 # FLAGS= # Create two temporary files. umask 077 TMPFILE=`mktemp /tmp/mutt.ldap.XXXXXX` RESULTS=`mktemp /tmp/mutt.ldap.XXXXXX` if [ -n "$LDAPSERVER" ]; then FLAGS="$FLAGS -h $LDAPSERVER" fi if [ -n "$LDAPBASEDN" ]; then FLAGS="$FLAGS -b $LDAPBASEDN" fi # Search. ldapsearch $FLAGS '(&(objectclass=inetorgperson)(|(cn='"$1"'*)(givenname='"$1"'*)(surname='"$1"'*)(mail='"$1"'*)))' mail cn roomNumber 2> /dev/null >> $TMPFILE ldapsearch -x $FLAGS '(&(objectclass=inetorgperson)(|(cn='"$1"'*)(givenname='"$1"'*)(surname='"$1"'*)(mail='"$1"'*)))' mail cn roomNumber 2> /dev/null >> $TMPFILE # Parse. cat $TMPFILE | awk ' /^mail:/ {MAIL=substr($0,6)} /^cn:/ {NAME=substr($0,4)} /^roomNumber:/ {ROOM=substr($0,12)} /^$/ { MAIL=gensub("^ *| *$","","g",MAIL) } /^$/ { NAME=gensub("^ *| *$","","g",NAME) } /^$/ { ROOM=gensub("^ *| *$","","g",ROOM) } /^$/ { if(length(NAME) > 0) print MAIL "\t" NAME "\t" ROOM} /^$/ { NAME = "" } ' > $RESULTS # Sort and present results. sort -u $RESULTS > $TMPFILE echo Querying ${LDAPSERVER}.... `cat $TMPFILE | wc -l` entries found. cat $TMPFILE # Clean up. rm -f $TMPFILE $RESULTS
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2