Module: Radd::Cli
- Defined in:
- lib/radd/cli.rb
Class Method Summary collapse
Class Method Details
.load_config ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/radd/cli.rb', line 7 def load_config config = {} parser = OptionParser.new parser. = 'Usage: radd --config [FILE]' parser.on('--config FILE', 'Config file') do |file| config['file'] = file end parser.parse! Radd.configure!(config['file']) end |
.start ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/radd/cli.rb', line 20 def start load_config puts "Starting Radd server for #{Radd.domain}" dns, http = Radd::Nameserver.new, Radd::Webserver.new Async do dns_task, http_task = dns.run, http.run watchdog = Async do sleep(1) while !http_task.failed? && !dns_task.failed? puts "Task failed!" exit(1) end end end |