-
-
Save MineThingIssues/f7b55284bc67167ff9ddbd12fdfeb812 to your computer and use it in GitHub Desktop.
Camera Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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