' \
'' \
"'
;;
/debug*)
printf "%s\15\12" "HTTP/1.0 200 OK" \
"Content-Type: text/plain" \
""
set
;;
###START OF DUMB / NON-INTELLIGENT GOPHER TYPES###
/[04569gshIpd]*)
printf "%s\15\12" "HTTP/1.0 200 OK"
case "$filename" in
/0*)
printf "%s\15\12" "Content-Type: text/plain"
;;
/4*)
printf "%s\15\12" "Content-Type: application/mac-binhex40"
;;
/5*)
printf "%s\15\12" "Content-Type: application/octet-stream"
;;
/6*)
printf "%s\15\12" "Content-Type: text/plain"
;;
/9*)
printf "%s\15\12" "Content-Type: application/octet-stream"
;;
/g*)
printf "%s\15\12" "Content-Type: image/gif"
;;
/s*)
printf "%s\15\12" "Content-Type: application/octet-stream"
;;
/h*)
printf "%s\15\12" "Content-Type: text/html"
;;
/I*)
printf "%s\15\12" "Content-Type: image/jpeg"
;;
/p*)
printf "%s\15\12" "Content-Type: image/png"
;;
/d*)
printf "%s\15\12" "Content-Type: application/pdf"
;;
esac
printf "%s\15\12" "Date: $date" \
"Server: gopher to http gateway at $fqdn" \
"Connection: close" \
""
lynx -anonymous -dump -source "gopher://$fqdn:70$filename"
;;
###END OF DUMB / NON-INTELLIGENT GOPHER TYPES###
*)
printf "%s\15\12" 'HTTP/1.0 200 OK' \
'Content-Type: text/html; level=1' \
"Date: $date" \
"Server: gopher to http gateway at $fqdn" \
'Connection: close' \
'' \
''
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 --uppercase-tags 1 --uppercase-attributes 1| \
sed -e 's/