#!/bin/sh
# time between each screen
refresh_timeout=5
# location of screens
home_dir=screens
# temp runtime file for tracking current screen
cntfile=/var/cnt
# if no cntfile (e.g. when starting) default to #1
if [ -f $cntfile ]; then
cnt=`cat $cntfile`
else
cnt=1
fi
# wrap when we run out
if [ ! -f ../$home_dir/$cnt.jpg ]; then
cnt=1
fi
# html stuff
echo "Content-type: text/html"
echo ""
echo "<HTML>"
echo "<HEAD>"
echo "<TITLE>Slideshow</TITLE>"
echo "<meta http-equiv=\"Refresh\" Content=\"$refresh_timeout; URL=/cgi-bin/display.sh\">"
echo "</HEAD>"
echo "<BODY bgcolor=\"#ffffff\" text=\"#ffffff\">"
echo "<a href=\"/cgi-bin/print.sh\"><img align=\"left\" img border=\"0\" img src=\"/$home_dir/$cnt.jpg\"</a>"
echo "</BODY></HTML>"
# point to next screen
let cnt="$cnt+1"
echo $cnt > $cntfile
# time between each screen
refresh_timeout=5
# location of screens
home_dir=screens
# temp runtime file for tracking current screen
cntfile=/var/cnt
# if no cntfile (e.g. when starting) default to #1
if [ -f $cntfile ]; then
cnt=`cat $cntfile`
else
cnt=1
fi
# wrap when we run out
if [ ! -f ../$home_dir/$cnt.jpg ]; then
cnt=1
fi
# html stuff
echo "Content-type: text/html"
echo ""
echo "<HTML>"
echo "<HEAD>"
echo "<TITLE>Slideshow</TITLE>"
echo "<meta http-equiv=\"Refresh\" Content=\"$refresh_timeout; URL=/cgi-bin/display.sh\">"
echo "</HEAD>"
echo "<BODY bgcolor=\"#ffffff\" text=\"#ffffff\">"
echo "<a href=\"/cgi-bin/print.sh\"><img align=\"left\" img border=\"0\" img src=\"/$home_dir/$cnt.jpg\"</a>"
echo "</BODY></HTML>"
# point to next screen
let cnt="$cnt+1"
echo $cnt > $cntfile