#!/bin/bash # album--Online photo album script echo "Content-type: text/html" echo "" setglobal header = '"header.html'" setglobal footer = '"footer.html'" setglobal count = '0' if test -f $header { cat $header } else { echo "
" } echo "" for name in [$[file /var/www/html/* | grep image | cut -d: -f1]] { setglobal name = $[basename $name] if test $count -eq 4 { echo "
" setglobal count = '1' } else { echo "" setglobal count = $shExpr(' $count + 1 ') } setglobal nicename = $[echo $name | sed 's/.jpg//;s/-/ /g] echo "
" echo "$nicename" } echo "
" if test -f $footer { cat $footer } else { echo "
" } exit 0