Skip to content

Instantly share code, notes, and snippets.

@strrife
Created July 26, 2018 13:03
Show Gist options
  • Save strrife/23d4b87250d044d07a6c4c34cd5f6eee to your computer and use it in GitHub Desktop.
Save strrife/23d4b87250d044d07a6c4c34cd5f6eee to your computer and use it in GitHub Desktop.
#!/bin/bash
TIME=`date '+%Y-%m-%d-%H-%M-%S'`
echo "Using Time identifier: $TIME";
INDEX=0
gphoto2 --auto-detect | tail -n +3 | awk '{print $4}' | while read line
do
rm -f capt0000.jpg
gphoto2 --capture-image-and-download --port=$line --force-overwrite
cp capt0000.jpg taken/$TIME"-"$INDEX.jpg
python main.py taken/$TIME"-"$INDEX.jpg
let INDEX=${INDEX}+1
done
ls taken
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment