#!/bin/sh
#
#

   number=$QUERY_STRING

   if [ `echo ${number} | head -c 4` = "rfc=" ]; then
        number=`echo ${number} | tail -c +5`
     fi

   file=rfc${number}.txt

   echo Content-type: text/html
   echo
   echo \<html\>

   if [ -r /usr/doc/rfc/${file}.gz ]; then

        echo \<head\>\<title\> Request For Comment \#${number} \</title\>\</head\>
        echo \<body\>
        echo \<h1\> Request For Comment \#${number} \</h1\>
        echo \<h3\> rfc$number.txt.gz \</h3\>
        echo \<hr\>\<pre\>

        gunzip -c /usr/doc/rfc/${file}

        echo \</pre\>

     else

        echo \<head\>\<title\> Request For Comment - Illegal Request \</title\>\</head\>
        echo \<body\>
        echo \<h3\> Illegal Request ... \</h3\> \<hr\>
        echo \<h4\>\"${number}\" is not a valid RFC number ! \</h4\>

     fi

   echo \</body\>
   echo \</html\>

   exit

