Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 15 lines (11 sloc) 520 Bytes
#!/usr/bin/ruby -w
# for some reason unknown, motion will not properly intialize on its first run, never
# collecting camera input(!). We reset it shortly after boot.
rebooted = File.mtime('/tmp/last_rebooted')
puts "delayed reboot -- last reboot time [#{rebooted.to_s}]"
raise "Not yet safe to restart motion!" unless - rebooted > 90
raise "Motion has already been restarted!" if File.exists?('/tmp/last_reset') and File.mtime('/tmp/last_reset') > rebooted
`touch /tmp/last_reset`