Sha256: 26fd1b18a433f230485496380b003451e77e286565b6511a965577cf42ec1682

Contents?: true

Size: 483 Bytes

Versions: 1

Compression:

Stored size: 483 Bytes

Contents

module VagrantPlugins
  module GuestLinux
    module Cap
      class ReadIPAddress
        def self.read_ip_address(machine)
          command = "LANG=en ifconfig  | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1 }'"
          result  = ""
          machine.communicate.sudo(command) do |type, data|
            result << data if type == :stdout
          end

          result.chomp.split("\n").first
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vagrant-cloudstack-1.2.0 vendor/bundle/bundler/gems/vagrant-c84e05fd063f/plugins/guests/linux/cap/read_ip_address.rb