#!/bin/sh

imagedir=/u/t/tactix/httpd/syntac.net/imagecast

imageno=`echo $QUERY_STRING | cut -d'-' -f1`
dirno=`echo $QUERY_STRING | cut -d'-' -f2`

if test ! -f ${imagedir}/${dirno}/i${imageno}-live.jpg; then
  echo Content-type: text/html
  echo
  echo "<HTML><HEAD><TITLE>ERROR</TITLE></HEAD><BODY>"
  echo "<H2>Invalid image request.</H2>"
  echo "Could not find "
  echo "<BR>"
  echo "Go back to <A HREF=\"http://www.syntac.net/imagecast\">"
  echo "www.syntac.net/imagecast</A></BODY></HTML>"
  exit 0
fi

echo Content-type: image/jpeg
echo

cat ${imagedir}/${dirno}/i${imageno}-live.jpg

exit 0
