#!/bin/sh
# Test script for creating dated webcam-files.
#
BASEDIR=/usr/people/robin/public_html

#touch $BASEDIR/TEST/`date '+%m%d%H%M'`
day=`/usr/bin/date '+%m%d'`
when=`/usr/bin/date '+%m%d%H%M'`

/usr/bin/mkdir -p $BASEDIR/$day
cd $BASEDIR/$day

# -n needs to be used on O2 for the other input.
# -v 1 is the O2cam, -v 0 is video-in.
# Hint: use vlinfo to find the correct number for the -v option.

# Here we take a picture from the Video-in input.....
/usr/sbin/vidtomem -n 0 -v 2 -f v$when > /dev/null 2>&1
/usr/sbin/imgcopy v${when}-00000.rgb v${when}.jpg > /dev/null 2>&1
/bin/rm -f v${when}-00000.rgb
/usr/bin/cp v${when}.jpg $BASEDIR/v-last.jpg

# Here we take a picture from the O2cam.....
/usr/sbin/vidtomem -n 0 -v 1 -f c$when > /dev/null 2>&1
/usr/sbin/imgcopy c${when}-00000.rgb c${when}.jpg > /dev/null 2>&1
/bin/rm -f c${when}-00000.rgb
/usr/bin/cp c${when}.jpg $BASEDIR/c-last.jpg


# scp the last shot's to other system....
#/usr/freeware/bin/scp robin@argus:public_html/datecap/
