#!/bin/sh
#this is a simple script demonstrating the location header and
#a very crude password authentication.

PASSWORD=Schmoo

#replace the following path with the path of the file you
#want to serve.
PROTECTEDFILE=/usr/people/somedir/somepage.html

if [ $# = 0 ]
then
   cat << EOM
	Content-Type: text/html

	<TITLE>Password example</TITLE>
	<ISINDEX>
	<H1>Protected page. Enter password</H!>
EOM
elif [ "$*" = "$PASSWORD" ] 
then
	echo Location: $PROTECTEDFILE
	echo
else
	cat << EOM2
	    Content-Type: text/html

	    <TITLE>Password example</TITLE>
	    <ISINDEX>
	    <H1>Password failed. Try again</H1>
EOM2
fi

