Class: DCase::Cli
- Inherits:
-
Object
- Object
- DCase::Cli
- Defined in:
- lib/dcase/cli.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Cli
constructor
A new instance of Cli.
- #run ⇒ Object
Constructor Details
Instance Method Details
#run ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/dcase/cli.rb', line 8 def run supervisor = \ case @config.side when 'local' puts "*** Local side is up, remote server port:#{@config.port}" DCase::Local.supervise('0.0.0.0', 53, @crypto, @config) when 'server' puts "*** Server side is up, port:#{@config.port}, with dns list: #{@config.dns_list.join(', ')}" DCase::Server.supervise('0.0.0.0', @crypto, @config) end puts "*** Hit Ctrl+c to stop" trap("INT") { supervisor.terminate; exit } trap("TERM") { supervisor.terminate; exit } sleep end |