Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site sdcsvax.UUCP Path: utzoo!linus!philabs!prls!amdimage!amdcad!amd!pesnta!hplabs!sdcrdcf!sdcsvax!jww From: jww@sdcsvax.UUCP (Joel West) Newsgroups: net.mail Subject: Re: Hosts.txt Filter Needed Message-ID: <1036@sdcsvax.UUCP> Date: Wed, 14-Aug-85 11:29:24 EDT Article-I.D.: sdcsvax.1036 Posted: Wed Aug 14 11:29:24 1985 Date-Received: Tue, 20-Aug-85 03:46:28 EDT References: <1342@rocksvax.UUCP> Organization: CACI, Inc - Federal, La Jolla Lines: 69 > Has anyone written a filter which will translate the Arpanet Hosts.txt > file into a syntax that Pathalias can use? I'd like to add Arpa sites > to my mailrouting code without having to spend huge amounts of time in > the editor (Hosts.txt changes a lot). > > arpa: Wegeng.Henr@Xerox.ARPA > csnet: Wegeng.Henr@Xerox.ARPA > ns: dw:Wbst207V:Xerox > uucp: {allegra,amd,decvax!rochester,princeton}!rocksvax!dw Here's what I've got. It was a quick hack and probably could use some improvement, so let me know if you don't like it. Joel West CACI, Inc. - Federal (c/o Gould CSD) {decvax!sdcsvax,ihnp4!bonnie}!gould9!joel gould9!joel@NOSC.ARPA (also joel@NOSC) #!/bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #!/bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create the files: # MKARPA.sh # This archive created: Tue Aug 13 19:52:47 1985 export PATH; PATH=/bin:$PATH if test -f 'MKARPA.sh' then echo shar: over-writing existing file "'MKARPA.sh'" fi cat << \SHAR_EOF > 'MKARPA.sh' #!/bin/sh # @(#) MKARPA.sh 6/30/85 # /usr/local/uucp/maps/MKARPA.sh by Joel West# # Add ARPA /etc/hosts entries to pathalias database # Currently lists only canonical (1st) name for compactness # # To work at your site, add the following changes: # 1) Make SERVER to what you believe the most reliable gateway from your # location to the ARPA network. # 2) Change the grep to refer to the actual input file (name # shown is only a suggestion.) # 3) Modify your path table Makefile to include file LOC.ARPA # as a data file and pass option "-d ARPANET" to pathalias. # # May require some hand-editing of resultant file. For example, some # sendmail configurations and older versions of pathalias may barf on # a name with dots, e.g. "ucb-arpa.berkeley.edu" # # Please report any problems or changes to # ihnp4!bonnie!gould9!joel joel%gould9@NOSC.ARPA # SERVER=noscvax echo -n 'ARPANET = @{' >LOC.ARPA grep -v '^#' /etc/hosts.arpa | awk '{printf "%s, \n", $2 }' \ | sort -u | tail +2 \ | awk 'BEGIN {ORS=""; i=6} {if (i>5){printf "\n\t"; i=0}; print $0 ; i++}' \ >>LOC.ARPA echo 'VOID }(DEDICATED)' >>LOC.ARPA # Requires -d ARPANET in makefile echo >>LOC.ARPA echo "$SERVER ARPANET" >>LOC.ARPA SHAR_EOF # End of shell archive exit 0