The shell script for access to the
At its simplest level, Web access to the Archie archives can be obtained with a script in the form supplied with (for example) the NCSA server. This has the advantage of great simplicity and almost universal applicability (in that it tests for the existence of a local client, thus avoiding the most common cause of failure in new installations).
Archie output is in the form of a listing of directories and files which match the search string. These are sorted by hostname, but while they are obvious enough to the seasoned user, it is not immediately clear what the occasional user or novice should do with them.
Even less apparent is the course the user should take when an error is encountered, and the Archie client has a number of commandline options which are inaccessible from the original script.
As the whole operation is managed by a script, it seems reasonable to introduce further pre- and post-processing using standard Unix utilities to make the search specification more controllable and to reformat the output for more immediate use.
This version of the archie script implements
selection of the type of search (exact-match or Unix regular expression; and substring or case-sensitive);
number of hits to return;
the address of the server to use (choice as recommended by Archie author).
The output is reformatted so that directories and files are separately listed, and within each of those groups, the entries are in country (domain) order and in reverse chronological order within domain. Each entry is made into an anchor (hypertext link) so that the user can simply click on the entry in order to retrieve the file.
The processing overhead appears from tests to be acceptable, given the added utility of this approach. However, to avoid overloading the author's host, the script and associated tables are being made available for download so that it can be installed on other Unix HTTP servers.
The server selection has been made sticky, so that the new form presented with the response to a search preserves the user's selection of server.
Error handling has been fixed so that a server timeout is now trapped correctly and notified to the user.
Download the package into your server's CGI script directory. Unwrap the file with the GNU Zip decompresser and the tar command:
gunzip archiescript.tar.gz tar xvf archiescript.tar
This extracts the following files:
-rwxr-xr-x 1 nobody 5540 Mar 20 11:37 archie -rw-r--r-- 1 nobody 2841 Mar 20 11:45 archiedoc.txt -rw-r--r-- 1 nobody 2683 Mar 4 16:57 domains1 -rw-r--r-- 1 nobody 2930 Mar 4 17:01 domains2
This documentation is in the archiedoc.txt file. The domain files are the lookup tables to convert between ISO 3166 two-letter country codes are full country names (split into two parts so that the script will run even on machines with limited memory).
To localize the software, edit the archie script and make changes to the block which defines the environment variables:
# Local facilities configuration THISHOST=`hostname` THISDOMAIN=`domainname` MYHOME="$THISHOST.$THISDOMAIN" SCRIPTHOME="cgi-bin/archie" ARCHIE=/usr/local/bin/archie # Set one (only) of these to "checked" for the local default server UK="" FI="" CA="checked" US="" AU=""
The first three variables should only be changed if your system does not support the hostname and domainname calls. SCRIPTHOME should be set to the directory and filename that the script occupies. ARCHIE should reference your local copy of the Archie client executable. The final set refers to the five servers recommended by Brendan Kehoe for use with the Archie client, and one of them (one only) should be set to "checked" so that it will be preselected in the HTML form display.
The two lookup tables domains1 and domains2 should reside in the CGI directory as they are referenced directly from calls to sed in the script. They are two files simply because using a single file (and a single call to sed) crashed out on `too many lines' on the development system (SunOS 4.1.3).
The script has been tested for several weeks and appears to function correctly, but has not been tested outside the development environment of the NCSA httpd under SunOS 4.1.3.
I will respond to bug reports and requests for enhancement, but I cannot give a fixed timescale for changes.
Peter Flynn