Sha256: f4f16347c3e7c83e8c4e1c12250579fd1ff18fd61a2b951335c4008f9fcd6e75

Contents?: true

Size: 442 Bytes

Versions: 5

Compression:

Stored size: 442 Bytes

Contents

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

          result.chomp
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
vagrant-shell-0.2.9 demo/templates/vendor/bundle/ruby/1.9.1/gems/tnargav-1.2.2/plugins/guests/linux/cap/read_ip_address.rb
vagrant-shell-0.2.8 demo/templates/vendor/bundle/ruby/1.9.1/gems/tnargav-1.2.2/plugins/guests/linux/cap/read_ip_address.rb
vagrant-shell-0.2.6 vendor/bundle/gems/tnargav-1.2.2/plugins/guests/linux/cap/read_ip_address.rb
vagrant-shell-0.2.5 vendor/bundle/gems/tnargav-1.2.2/plugins/guests/linux/cap/read_ip_address.rb
tnargav-1.2.2 plugins/guests/linux/cap/read_ip_address.rb