Method: Specinfra::Command::Darwin::Base::Host.check_is_reachable

Defined in:
lib/specinfra/command/darwin/base/host.rb

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

[View source]

15
16
17
18
19
20
21
# File 'lib/specinfra/command/darwin/base/host.rb', line 15

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