'
echo -e ''
echo -e "'
;;
/debug*)
echo -e "HTTP/1.0 200 OK\r"
echo -e "Content-Type: text/plain\r"
echo -e "\r"
set
;;
###START OF DUMB / NON-INTELLIGENT GOPHER TYPES###
/0*|/4*|/5*|/6*|/9*|/g*|/s*|/h*|/I*|/p*|/d*)
echo -e "HTTP/1.0 200 OK\r"
case "$filename" in
/0*)
echo -e "Content-Type: text/plain\r"
;;
/4*)
echo -e "Content-Type: application/mac-binhex40\r"
;;
/5*)
echo -e "Content-Type: application/octet-stream\r"
;;
/6*)
echo -e "Content-Type: text/plain\r"
;;
/9*)
echo -e "Content-Type: application/octet-stream\r"
;;
/g*)
echo -e "Content-Type: image/gif\r"
;;
/s*)
echo -e "Content-Type: application/octet-stream\r"
;;
/h*)
echo -e "Content-Type: $CONTENT_TYPE\r"
;;
/I*)
echo -e "Content-Type: image/jpeg\r"
;;
/p*)
echo -e "Content-Type: image/png\r"
;;
/d*)
echo -e "Content-Type: application/pdf\r"
;;
esac
echo -e "Date: $date\r"
echo -e "Server: gopher to http gateway at $FQDN\r"
echo -e "Connection: close\r"
echo -e "\r"
/usr/bin/lynx -anonymous -dump -source gopher://$FQDN:70$filename
;;
###END OF DUMB / NON-INTELLIGENT GOPHER TYPES###
*)
echo -e "HTTP/1.0 200 OK\r"
echo -e "Content-Type: text/html; level=1\r"
echo -e "Date: $date\r"
echo -e "Server: gopher to http gateway at $FQDN"
echo -e "Connection: close\r"
echo -e "\r"
echo -e ''
/usr/bin/lynx -anonymous -dump -source gopher://$FQDN:70$filename | \
tidy -in -w 0 -cn --doctype omit --show-errors 0 --show-warnings 0 --tidy-mark 0 --quiet 1 | \
sed -e 's/