#!/bin/bash

DBGFILE=/tmp/sh-httpd.log

date >> $DBGFILE
H="IGNORE"
while [ "$H" != "" ] ;
do
	echo $H >> $DBGFILE
	read H
	H=`echo $H | sed -e 's///g'`
done

echo 'HTTP/1.1 200 OK'
echo -n "Date: "'
date|sed 's/ /, /''
echo 'Server: sh-http/0.01 (Linux/bash)'
echo 'Accept-Ranges: bytes'
echo 'Connection: close'
echo 'Content-Type: text/html'
echo ''

echo '<?xml version="1.0" encoding="ISO-8859-1"?>'
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'
echo '<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">'
echo '<head><title>Zaurus sh-httpd daemon</title></head>'
echo '<body bgcolor="#ffffff">'

echo "<p>"
echo "<b>hello</b>"
echo "</p>"
echo "</html>"

echo "finished" >> $DBGFILE

# end sh-httpd
