#!/usr/bin/sh # Search the ListProc subscriber/ignored/owners files # Created by David Rosenthal and Meir Green # Created Dec 15, 1997 # Ver 1.20 # Mar 1 1998 LPDIR="/var/listproc" USAGE="Usage: list.user.find [-t] [listname] -t Two word search term (ie firstname lastname)" if [ "$1" = "" ]; then echo "$USAGE" exit 1 fi if [ "$1" = "-t" ] ; then TERM="$2 $3" LIST="$4" else TERM="$1" LIST="$2" fi LIST=`echo $LIST | tr '[:lower:]' '[:upper:]'` #echo "$TERM is on the following lists:" if [ "$LIST" = "" ]; then grep -i "$TERM" $LPDIR/lists/*/.subscribers ignorefile="$LPDIR/.ignored $LPDIR/lists/*/.ignored" ignored=`grep -i "$TERM" $ignorefile` if [ "$ignored" != "" ]; then echo "$TERM is in the ignore files:" echo "$ignored" fi ownersfile="$LPDIR/owners" owners=`grep -i "$TERM" $ownersfile` if [ "$owners" != "" ]; then echo "$TERM is the owner of:" echo "$owners" fi else grep -i "$TERM" $LPDIR/lists/$LIST/.subscribers fi