Skip to content

Instantly share code, notes, and snippets.

@MineThingIssues
Created February 18, 2019 17:30
Show Gist options
  • Save MineThingIssues/f7b55284bc67167ff9ddbd12fdfeb812 to your computer and use it in GitHub Desktop.
Save MineThingIssues/f7b55284bc67167ff9ddbd12fdfeb812 to your computer and use it in GitHub Desktop.
Camera Script
#!/bin/sh
SNAPSHOT_NUMBER=$1
DELAY_SECONDS=$2
DATA_DIRECTORY=$3
SNAPSHOT_DIRECTORY=$4
SNAPSHOT_FILENAME=$5
SNAPSHOT_FULL_PATH=$6
if [ ! -d "${SNAPSHOT_DIRECTORY}" ];
then
echo "Creating directory: ${SNAPSHOT_DIRECTORY}"
mkdir -p "${SNAPSHOT_DIRECTORY}"
fi
sudo gphoto2 --capture-image-and-download --filename "${SNAPSHOT_FULL_PATH}"
if [ ! -f "${SNAPSHOT_FULL_PATH}" ];
then
echo "The snapshot was not found in the expected directory: '${SNAPSHOT_FULL_PATH}'." >&2
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment