Article View: comp.sys.sun
Article #12119Re: Whois Server
From: Mike Raffety
Date: Sat, 22 Apr 1989 10:29
Date: Sat, 22 Apr 1989 10:29
37 lines
1757 bytes
1757 bytes
Sometimes the simplest solutions are best. We have a flat file set up on
a master server, which is "rdist"ed out to our primary servers.
("rdist(1)" is an absolutely INVALUABLE utility; if you've never heard of
it, take a few minutes to read the man page.)
All machines mount the filesystem with the file (and lots of other stuff)
from a primary server. Then, we have the "phone" command (a shell script)
to, basically, do a "grep" through the flat file. This file contains
names, phone extensions, login name, home phone number, and beeper number,
one line per person, along with a little other commonly useful info. Note
that phone supports the concept of local and group phone lists, too, and
that you can use it to do reverse directory lookups.
The phone script follows:
#!/bin/sh
#
# @(#)phone.sh 1.2 2/2/88
#
# The phone lists are located here:
main_list=/run/usr/lib/phone_list
my_lists="$main_list ${PHONE_LIST-${HOME}/phone_list}"
# See if we have a command line argument; if not, prompt for one
if [ $# -eq 0 ] ; then
echo -n "Enter name or number: " ;
read a ;
else
a="$*" ;
fi
# Look in the lists
for list in ${my_lists} ; do
if [ -r ${list} ] ; then
grep -i -h -e "$a" ${list} ;
fi ;
done
Technical Details
Message-ID:
<8903311629.AA13413@porsche>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-requestShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-request From: sunloop!oconnor!porsche!miker@central.sun.com (Mike Raffety) Newsgroups: comp.sys.sun Subject: Re: Whois Server Keywords: Software Message-ID: <8903311629.AA13413@porsche> Date: 22 Apr 89 10:29:38 GMT Sender: usenet@rice.edu Organization: Sun-Spots Lines: 37 Approved: Sun-Spots@rice.edu Original-Date: Fri, 31 Mar 89 10:29:03 CST X-Sun-Spots-Digest: Volume 7, Issue 239, message 11 of 21