#!/bin/bash ####################################################### # begin config section What=cs472 Default=index Src=${Src='http://www.unbox.org/open/trunk/472/14/spring/doc'} Cat=${Cat=' wget -q -O - '} Markdown=${Markdown:='/home/stuff/env/bin/markdown_py'} Files='index.cgi' header() { cat<<-EOF $What: $1 EOF } # end config section ######################################################### # from here down, you should not need to change anything Q=${QUERY_STRING:=$Default} Q=$(echo $Q | sed 's/[^\/\.0-9a-zA-Z]//g') echo "Content-type: text/html" echo "" if [ "$Q" = "REFRESH" ] then for i in $Files; do wget -q -O - $Src/$i > $i done chmod 755 index.cgi echo "
"; echo ""; date
    cksum  $Files
    echo "`cat $Files | cksum` TOTAL"
    echo 'Continue.'
else
    header $Q
    $Cat $Src/header.html
    $Cat $Src/${Q}.md | $Markdown
    $Cat $Src/footer.html
fi