Index: trunk/DataStoreServer/web/cgi/dsfits.cgi
===================================================================
--- trunk/DataStoreServer/web/cgi/dsfits.cgi	(revision 16763)
+++ trunk/DataStoreServer/web/cgi/dsfits.cgi	(revision 17381)
@@ -1,43 +1,3 @@
-#!/usr/bin/env perl
-
-use strict;
-use CGI ':standard';
-
-my $DS_DIR = '/var/www/html/ds/dsroot';
-#my $DS_DIR = '.';
-
-my $uri = $ENV{'REQUEST_URI'};
-
-$uri = $ARGV[0];
-print STDERR "uri is $uri\n";
-
-(my $left, my $param) = split(/\,/, $uri);
-
-print STDERR "left: $left param: $param\n";
-
-if ($left !~ /\.fits$/) {
-	print header( -status => '404 Not Found' );
-	exit;
-}
-
-my @path = split(/\//, $left);
-
-my $fn = @path[$#path];
-my $fpath = $DS_DIR.'/'.$left;
-
-
-
-print header(	-type => 'image/fits',
-				-attachment => $fn,
-				-content_length => -s $fpath,
-			);
-
-
-open F, $DS_DIR.'/'.$left;
-
-binmode(F);
-binmode(STDOUT);
-
-print while (<F>);
-
-close F;
+#!/bin/bash
+. ./dsshellconfig
+./dodsfits $*
