Created
February 5, 2013 05:54
-
-
Save rjp/4712542 to your computer and use it in GitHub Desktop.
Reliably run snowcam.sh at :00/:20/:40 seconds
This file contains hidden or 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
boot=$((SECONDS % 20)) | |
time=$(($(date +%s) % 20)) | |
offset=$((20-(time-boot))) | |
echo "boot=$boot time=$time offset=$offset" | |
while [ 1 ]; do | |
while [ $(((SECONDS-offset) % 20)) -lt 18 ]; do sleep 1; done | |
while [ $(((SECONDS-offset) % 20)) -lt 19 ]; do echo >/dev/null; done | |
sleep 1 | |
./snowcam.sh || exit | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment