#!/bin/sh # slideshow.sh -- output a series of gifs for a slideshow # Created by Howard Cohen, copyright 1996. A Timefold(tm) product. # hoco@timefold.com, http://www.timefold.com # # Right to use granted as long as the above copyrights and credits are # not altered. me=slideshow.sh wwwroot=/usr/home/hoco/pub/hoco/public_html # this is the pathname down to the root of the web area, # where you would find your home.html. Go to that # directory and execute 'pwd' to find out what to put # here. If you happen to see "/auto" or "/tmp_mount" at # the front of the pathname, strip off that part when you # specify the name here. [trust me -- hsc] debugfile=$wwwroot/cgi/scripts/debug/slidebug debug=N # set to Y to turn on debugging, but be sure to choose # a debugfile which you can access. /tmp may be # on a different machine (the one serving the web) from # the machine you log into in order to work on web pages. # also, the debug file must exist in a writable directory. delay=0 # set to a number of seconds to delay between slides, maybe... slidedir="$wwwroot/$PATH_INFO" # This is the path from the root of the # web down to the directory containing the # slides. if [ "$debug" = "Y" ] then umask 0 rm -f $debugfile date >$debugfile pwd >>$debugfile echo "$me" "$@" >>$debugfile echo "slidedir=$slidedir" >> $debugfile env >> $debugfile fi cd $slidedir slides=`ls *.gif | sort -n` if [ "$debug" = "Y" ] then echo "$slides" >>$debugfile fi # this header is required to run server push scripts echo "HTTP/1.0 200 Okay" # this prints the required Content-type header and defines the boundary # string. Notice that there is no space after the semicolon. # There is also a blank line after the header. echo "Content-type: multipart/x-mixed-replace;boundary=slide" echo for sl in $slides do # here is a new slide echo "--slide" # Introduce the content type and include a blank line echo "Content-type: image/gif" echo if [ "$debug" = "Y" ] then echo sending $sl >>$debugfile fi cat $sl if [ "$delay" -gt 0 ] then sleep $delay fi echo done echo "--slide--"