aboutsummaryrefslogtreecommitdiff
path: root/apps/timelapse/timelapse.rb
diff options
context:
space:
mode:
Diffstat (limited to 'apps/timelapse/timelapse.rb')
-rwxr-xr-xapps/timelapse/timelapse.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/apps/timelapse/timelapse.rb b/apps/timelapse/timelapse.rb
new file mode 100755
index 000000000000..aa6b6b3106ae
--- /dev/null
+++ b/apps/timelapse/timelapse.rb
@@ -0,0 +1,13 @@
+#!/usr/bin/env ruby
+
+# A function to capture a picture with gphoto2, retrying 3-times in
+# case of errors.
+def capture_picture
+ 3.times do
+ break if `gphoto2 --capture-image` == 0
+ puts "Retrying gphoto2 capture..."
+ end
+end
+
+
+capture_picture