Class: Specinfra::Command::Darwin::Base::Host

Inherits:
Base::Host show all
Defined in:
lib/specinfra/command/darwin/base/host.rb

Class Method Summary collapse

Methods inherited from Base::Host

check_is_resolvable, get_ipaddress

Methods inherited from Base

create, escape

Class Method Details

.check_is_reachable(host, port, proto, timeout) ⇒ Object


3
4
5
6
7
8
9
# File 'lib/specinfra/command/darwin/base/host.rb', line 3

def check_is_reachable(host, port, proto, timeout)
  if port.nil?
    "ping -t #{escape(timeout)} -c 2 -n #{escape(host)}"
  else
    "nc -vvvvz#{escape(proto[0].chr)} #{escape(host)} #{escape(port)} -w #{escape(timeout)}"
  end
end