#!/bin/sh  
#
#########################################################################3
#  SSW CGI service
#  Circa Jan 1-2002 - S.L.Freeland
#  22-April-2004 - add hooks for response_file (cosec_mode=2)
#########################################################################3

#########################################################################3
#                  get POST query and save to file 
#########################################################################3
date=`/bin/date +%y%m%d_%H%M%S`
service_parent=`cat service_parent`
query_file="$service_parent""/post_response/ssw_service_""$date""_""$$"
echo $QUERY_STRING\&"ssw_service=xxx" > $query_file
service_output="$query_file""_response.html"
#########################################################################
#               Execute SSWIDL command w/query file input
#########################################################################
idlcmd="ssw_service,qfile='""$query_file'"
./idlRpcClient 0x2010cafa penumbra "$idlcmd"
#########################################################################3

echo Content-type: text/html
echo

if [ -f $service_output ]
then
   cat $service_output 
fi
