#! /bin/sh #Motion detection script for use with AXIS 205 webcam. #Written by David Bowler 5 Sep 2004 #Require packages: # netpbm ftp://metalab.unc.edu/pub/Linux/apps/graphics # This script may be freely copied and modified FRAMERATE=0.3 SENSITIVITY=32 PNMPSNR=/usr/bin/pnmpsnr cd /tmp/vid wget -q -m -N -nd -L -l2 -Y off --http-user=root --http-passwd=**** "http://192.168.29.46/jpg/image.jpg" djpeg -scale 1/4 -ppm /tmp/vid/image.jpg > /tmp/vid/image2.ppm while true do if [ ! -d /home/video/tea/`date +%m%d` ] then mkdir /home/video/tea/`date +%m%d` fi wget -q -m -N -nd -L -l2 -Y off --http-user=root --http-passwd=***** "http://192.168.29.46/jpg/image.jpg" sleep $FRAMERATE djpeg -scale 1/4 -ppm /tmp/vid/image.jpg > /tmp//vid/image.ppm $PNMPSNR /tmp/vid/image.ppm /tmp/vid/image2.ppm>/tmp/vid/Ycolour 2>&1 Y=`/bin/awk '/Y color/ {print int($5)}' /tmp/vid/Ycolour` if [ $Y -lt $SENSITIVITY ] then cp /tmp/vid/image.jpg /home/video/tea/`date +%m%d`/`date +%m%d%H%M%S.jpg` fi mv /tmp/vid/image.ppm /tmp/vid/image2.ppm done