Skip to content

Instantly share code, notes, and snippets.

@AlexKovax
Created January 19, 2014 21:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save AlexKovax/8511385 to your computer and use it in GitHub Desktop.
Save AlexKovax/8511385 to your computer and use it in GitHub Desktop.
This basic shell script uses the raspistill command to take a shot with different settings depending on the time. It's made to be called using a crontab
#!/bin/bash
#fakewebcam script
TIME=$(date +"%H")
DAY='10'
NIGHT='20'
if [ ${TIME} -ge ${DAY} -a ${TIME} -le ${NIGHT} ]; then
#echo "It's day!"
raspistill -q 90 -w 640 -h 480 -t 60 -o /var/www/webcam.jpg
else
#echo "It's night!"
raspistill -q 90 -w 640 -h 480 -ex night -t 10000 -o /var/www/webcam.jpg
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment