#!/bin/sh

export photo_dir=/shm/`date +"%Y-%m-%d"`
mkdir -p $photo_dir
echo '
list-config
set-config /main/capturesettings/canonflashmode 1
get-config /main/capturesettings/canonflashmode' | \
gphoto2 --shell
#set-config imagesize 3
#get-config imagesize
#set-config imagequality 2
#get-config imagequality

export photo_dir=/shm/`date +"%Y-%m-%d"`
mkdir -p $photo_dir

gphoto2 --capture-image --interval  1 --hook-script /home/orion/bin/test-hook.sh


exit 0
# check the camera's ok
gphoto2 --list-config

echo
echo if that didn\'t look right, now\'s a good time to hit ctrl-c
echo try "gphoto2 --capture-image" and then run this script again
sleep 3


# turn on flash
gphoto2 --set-config /main/capturesettings/canonflashmode=0
gphoto2 --get-config /main/capturesettings/canonflashmode
# set to macro mode
#gphoto2 --set-config /main/capturesettings/afdistance=0
#gphoto2 --get-config /main/capturesettings/afdistance


export photo_dir=/shm/`date +"%Y-%m-%d"`
mkdir -p $photo_dir

gphoto2 --capture-image --interval  1 --hook-script /home/rafi/bin/test-hook.sh
echo capture-image-and-download | gphoto2 -I 1 --filename "%y-%m-%d_%H:%M:%S.jpg" --hook-script ./test-hook.sh --shell
