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

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

.get_ipv4_address(name) ⇒ Object


29
30
31
32
# File 'lib/specinfra/command/darwin/base/host.rb', line 29

def get_ipv4_address(name)
  ## With dscacheutil multiple IPs can be returned for IPv4 just pick the first one
  %Q{dscacheutil -q host -a name #{escape(name)} | awk '/^ip_/{ print $2; exit }'}
end