summaryrefslogtreecommitdiff
path: root/leap_ca.rb
diff options
context:
space:
mode:
Diffstat (limited to 'leap_ca.rb')
-rwxr-xr-x[-rw-r--r--]leap_ca.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/leap_ca.rb b/leap_ca.rb
index 57bf067..baefff2 100644..100755
--- a/leap_ca.rb
+++ b/leap_ca.rb
@@ -1,19 +1,21 @@
#!/usr/bin/ruby
require 'rubygems'
+require 'daemons'
require 'yajl/http_stream'
+
require 'lib/cert'
require 'lib/couch_stream'
require 'lib/couch_changes'
require 'lib/pool'
-def main
- puts "Tracking #{Cert.database.root}"
- couch = CouchStream.new(Cert.database.root)
- changes = CouchChanges.new(couch)
- pool = LeapCA::Pool.new(File.expand_path("../config/pool.yml", __FILE__))
- pool.fill
+puts "Tracking #{Cert.database.root}"
+couch = CouchStream.new(Cert.database.root)
+changes = CouchChanges.new(couch)
+pool = LeapCA::Pool.new(File.expand_path("../config/pool.yml", __FILE__))
+pool.fill
+Daemons.run_proc('leap_ca.rb') do
changes.follow do |hash|
p hash
if hash[:deleted]
@@ -21,5 +23,3 @@ def main
end
end
end
-
-main