2 #for instructions or updates go to:
3 #<A HREF="http://math.ucr.edu:8889/">This script's home page</A>
4 #email me questions or comments at:
5 #<A HREF="mailto:insom@math.ucr.edu">insom@math.ucr.edu</A>
6 #copyright chris ulrich; This software may be used or modified
7 #in any way so long as this notice remains intact.
10 # Author: Chris Ulrich <chris@tinker.ucr.edu>
15 DOCHOME
=/home
/insom
/web-docs
16 BINHOME
=/home
/insom
/web-bin
17 LOGHOME
=/home
/insom
/web-logs
18 LOGFILE
=$LOGHOME/access_log
21 exec 2>> $LOGHOME/error_log
31 echo "Content-type: $1
41 #case "$#" in 2) ;; *) echo eep! | mailx insom@math.ucr.edu ; exit 3 ;; esac
42 if test -f "$DOCHOME/$2"
52 if test -f "$DOCHOME/$url/.title"
54 header
"text/html; charset=US-ASCII"
56 cat "$DOCHOME/$url/.title"
58 elif test -f "$DOCHOME/$url/.title.html"
60 header
"text/html; charset=US-ASCII"
61 cat "$DOCHOME/$url/.title.html"
63 header
"text/html; charset=US-ASCII"
76 echo "<A HREF=\"$url$link\">$link</A> <BR>"
85 $date access from ${TCPREMOTEINFO:=NO-IDENT}@${TCPREMOTEHOST:=$TCPREMOTEIP}
86 on local machine $TCPLOCALHOST
87 $method $data " >> $LOGFILE
91 url
="${url}${url:+ }$second"
119 send
"text/plain; charset=US-ASCII" "$url"
122 send
"text/html; charset=US-ASCII" "$url"
125 if test -x "$DOCHOME/$url"
128 echo "$message" |
"$DOCHOME/$url"
136 IFS
='?' read url QUERY_STRING
137 if test -x "$DOCHOME/$url"
148 send
"image/gif" "$url"
150 *.
[Jj
][Pp
][Gg
]|
*.
[Jj
][Pp
][Ee
][Gg
])
151 send
"image/jpeg" "$url"
154 header
"text/html; charset=US-ASCII"
156 test -f "$DOCHOME/$url" &&
157 tbl
< "$DOCHOME/$url" | nroff ||
162 header
"text/html; charset=US-ASCII"
164 test -f "$DOCHOME/$url" &&
165 nroff
< "$DOCHOME/$url" ||
170 if test -f "$DOCHOME/$url"
172 header
"application/mpstream"
173 echo "+$TCPLOCALIP:${MPSERVPORT:=9001}/$url"
178 *.
[0-9]|
*.
[0-9][a-z
])
179 header
"text/html; charset=US-ASCII"
181 if test -f "$DOCHOME/$url"
183 #nroff -man "$DOCHOME/$url" | $BINHOME/man2html
184 echo "perl at the moment is broken, so man2html doesn't work. Sorry."
191 send
"unknown/data" "$url"
194 if test -d "$DOCHOME/$url"
196 ls "$DOCHOME/$url" | LsToHTML
200 if test -f "$DOCHOME/$url"
202 read filetype
< "$DOCHOME/$url"
205 header
"text/plain; charset=US-ASCII"
209 header
"text/html; charset=US-ASCII"
213 header
"text/html; charset=US-ASCII"
219 elif test -f "$DOCHOME/$url/$INDEX"
221 header
"text/html; charset=US-ASCII"
222 cat "$DOCHOME/$url/$INDEX"
223 elif test -d "$DOCHOME/$url"
225 ls "$DOCHOME/$url" | LsToHTML