#!/usr/bin/perl #MODIFIED FROM http://www.perl.com/doc/manual/html/lib/File/Compare.html use File::Compare; if (compare("/root/www/wxcam/21/current.jpg","/root/www/wxcam/21/upload.jpg") == 0) { #compares uploaded file with most recent #if they match # print "They're equal\n"; } else { #if they dont match # print "Eeeeeeeernt!\n"; #do a system call (3 parts, couldn't get one to work) #system call 1.) copies new cam to static slot, 2.) copies that image to a dated name, 3.) lists files into an index exec "cp -f /root/www/wxcam/21/upload.jpg /root/www/wxcam/21/current.jpg ;cp /root/www/wxcam/21/current.jpg /root/www/wxcam/21/`date +%Y-%m%-%d_%H%M.jpg`; /usr/home/bin/jcam"; } #/usr/home/bin/jcam looks like this: ##!/bin/csh #cd wxcam/21 # #rm -f images.html #foreach j (05*.jpg) #echo "
$j

" >> images.html #end