#!/usr/local/bin/perl # # -*- Perl -*- # # Dispatch the URL to one of the filter programs that makes up the DODS # server. The filter program is executed by this script using exec. If the # filter program cannot be run, return an error message. # # See the DODS_Dispatch.pm class for information about how environment # variables are used. # # NB: This script assumes that all data is rooted in the http document # directory subtree. If you want to access files outside that subtree, use a # symbolic link and make sure that your server is set to follow symbolic # links. To configure your server to follow symbolic links, add # FollowSymLinks to the Options in the access.conf file. # # $Id: nph-nc,v 1.16 1998/08/06 16:33:27 jimg Exp $ # # $Log: nph-nc,v $ # Revision 1.16 1998/08/06 16:33:27 jimg # Fixed misuse of the read(...) member function. Return true if more data # is to be read, false is if not and error if an error is detected # # Revision 1.15 1998/02/05 20:14:49 jimg # DODS now compiles with gcc 2.8.x # # Revision 1.14 1997/06/12 21:03:36 jimg # Removed the DODS_ROOT environment variable. # # Revision 1.13 1997/06/06 03:58:33 jimg # Rewrote to use the new Perl DODS_Dispatch class. # use Env; use DODS_Dispatch; # Set the DODS_ROOT environment variable. This is done so that the filter # programs which do the real work of the server can find gzip when it is not # on the user's PATH but *is* in DODS_ROOT/etc. NB: The filter program # appends the `etc'. # $ENV{'DODS_ROOT'} = "/usr/local/DODS-2.13"; NOT USED my $script_rev = '$Revision: 1.16 $ '; $script_rev =~ s@\$([A-z]*): (.*) \$@$2@; # The DODS_Dispatch object reads information from the environment variables # and builds up a command based on the format of a DODS URL. $dispatch = new DODS_Dispatch($script_rev, "jimg\@dcz.cvo.oneworld.com"); $command = $dispatch->command(); if ($command ne "") { # if no error... exec($command); } else { $dispatch->print_error_msg($script_rev); }