#!/bin/sh REALDIR=${1:-/home/pe1rxq/src/motion/shots} PUBLICDIR=${2:-/shots} echo Content-type: text/html echo max-age: 0 echo expires: 0 echo pragma: no-cache echo echo "" echo "" echo "" echo Motion detector echo "" echo "

Motion detector

" echo -n "Last updated: "; date echo "
" echo "" echo "" cd $REALDIR # ls -1 *.jpg | tail -n 50| awk -v dir=$PUBLICDIR -- '{printf ("%s
\n", dir, $0, substr($0,1,index($0,".")-1))}' #ls -1 *.jpg | sed -e 's/\.jpg$//' -e 's/m$//' | sort -u | tail -n 50 | while read filebase ; do find -name "*.jpg"|cut -c 3- | sed -e 's/\.jpg$//' -e 's/m$//' | sort -u | tail -n 50 | while read filebase ; do if [ -f ${filebase}.jpg ] ; then echo "" fi if [ -f ${filebase}m.jpg ] ; then echo "" fi echo "$filebase
" done echo "" echo ""