#!/bin/sh
# WARNING: This file was automatically generated.  You may lose changes.
[ -z "$psp_conf" ] && psp_conf=/etc/psp.conf
[ -z "$piledir" ] && piledir=/usr/share/piles
[ -z "$piledriver" ] && piledriver=/usr/lib/cgi-bin/psp/piledriver.cgi

# Copyright (c) 2000, FundsXpress Financial Network, Inc.
# This library is free software released "AS IS WITH ALL FAULTS"
# and WITHOUT ANY WARRANTIES under the terms of the GNU Lesser
# General Public License, Version 2.1, a copy of which can be
# found in the "COPYING" file of this distribution.

# $Id: testpile,v 1.1.1.1 2003/12/06 19:47:26 hartmans Exp $

if [ "$1" = "-verbose" ]; then
  shift
  do_verbose=1
fi

if [ "$1" = "-debug" ]; then
  shift
  do_debug=1
fi

if [ "$1" = "-query" ]; then
  shift
  query_string=$1
  shift
fi

if [ "$1" = "" ]; then
  echo Usage: $0 '<url relative to /piles/>'
  exit 1
fi
pileurl=$1

[ -z "$PATH_TRANSLATED" ] && PATH_TRANSLATED="$piledir/$pileurl"
[ -z "$REDIRECT_URL" ] && REDIRECT_URL="/piles/$pileurl"
[ -z "$PSP_CONF" ] && PSP_CONF=$psp_conf
export PATH_TRANSLATED REDIRECT_URL PSP_CONF

[ ! -z "$do_debug" ] && perl_args="$perl_args -d"

display_url=http://server:port$REDIRECT_URL
[ "$query_string" ] && display_url="$display_url?$query_string"
echo Simulating $display_url ...

[ "$do_verbose" != "" ] && echo perl $perl_args $piledriver
perl $perl_args $piledriver
