Sha256: 51a6bef64ae3b4bffcac3d6fbd674e9240853601b4b5c6a01ab7b48d60a21bf9
Contents?: true
Size: 1.7 KB
Versions: 1
Compression:
Stored size: 1.7 KB
Contents
#!/usr/bin/env ruby require 'optparse' require 'methadone' require 'construct' require 'electric_eye.rb' include ElectricEye class App include Methadone::Main include Methadone::CLILogging main do |camera, url| # Add args you want: |like,so| @configEye = ConfigEye.new # Initialize config @record = Record.new(@configEye) # Initialize record and pass in our config if options[:a] # Add camera @configEye.add_camera(camera,url) elsif options[:r] # Remove camera @configEye.remove_camera(camera) elsif options[:l] # List cameras @configEye.list_cameras elsif options[:d] # Set duration @configEye.set_duration(options[:duration]) elsif options[:p] # Set path @configEye.set_path(options[:path]) elsif options[:s] # Start recording @record.start elsif options[:k] # Stop recordings @record.stop elsif options[:t] @configEye.set_threshold(options[:threshold]) else puts opts.help end exit 0 end description "Network Video Recorder" # Accept flags via: on("-a", "--add", "Add a camera") on("-r", "--remove", "Remove a camera") on("-l", "--list", "List cameras") on("-d", "--duration SECONDS", "Set recording duration in seconds (default: 600)") on("-p", "--path DIR", "Set recordings path") on("-s", "--start", "Start recordings") on("-k", "--stop", "Stop recordings") on("-t", "--threshold LEVEL", "Set threshold for motion detection (default: 2)") # Arguments arg :camera, :optional arg :url, :optional version ElectricEye::VERSION use_log_level_option :toggle_debug_on_signal => 'USR1' go! end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
electric_eye-0.0.5 | bin/electric_eye |