#!/bin/sh

#
#   WARNING !!!   N E V E R  use the script except for testing purposes !!!
#   ^^^^^^^      ~~~~~~~~~~~
# Script for Arena <isindex> tag handler testing and debugging.
# This is CGI script. Should reside in ``cgi-bin'' WWW server directory.
#

FINGER=/usr/bin/finger

echo Content-type: text/html
echo

if test -x $FINGER ;
 then
  if test $# = 0 ;
   then
    cat << EOM
<head>
<title>Finger Gateway</title>
</head>

<body>

<h1>Finger Gateway</h1>

<p><hr></p>

<isindex>

<p><hr></p>

<p>
This is a gateway to "finger".
Type a user@host combination in your browser's search dialog.
</p>

<p><hr></p>

</body>
EOM
   else
    # POTENTIALLY DANGEROUS!
    echo "<head><title>Finger Gateway</title></head><body><h1>finger $*</h1><p><pre>"
    # POTENTIALLY DANGEROUS!
    $FINGER "$*"
    echo "</pre></body>"
  fi
 else
  echo '<head><title>Finger Gateway</title></head><body><h1>Finger Failure</h1><p>Cannot find <tt>finger</tt> on this system.</p></body>'
fi

