Sha256: 1e479aaae3b1d3593dada286c9d3082db8869bce168ad27cbadb00603f084ce9

Contents?: true

Size: 609 Bytes

Versions: 31

Compression:

Stored size: 609 Bytes

Contents

module Veewee
  module Provider
    module Parallels
      module BoxCommand

        # Get the IP address of the box
        def ip_address
          mac=mac_address
          command="grep #{mac} /Library/Preferences/Parallels/parallels_dhcp_leases|cut -d '=' -f 1"
          ip=shell_exec("#{command}").stdout.strip.downcase
          return ip
        end

        def mac_address
          command="prlctl list -i '#{self.name}'|grep 'net0 (' | cut -d '=' -f 3 | cut -d ' ' -f 1 "
          mac=shell_exec("#{command}").stdout.strip.downcase
          return mac
        end

      end
    end
  end
end

Version data entries

31 entries across 31 versions & 2 rubygems

Version Path
veewee-0.3.4 lib/veewee/provider/parallels/box/helper/ip.rb
veewee-0.3.3 lib/veewee/provider/parallels/box/helper/ip.rb
veewee-0.3.2 lib/veewee/provider/parallels/box/helper/ip.rb
veewee-0.3.1 lib/veewee/provider/parallels/box/helper/ip.rb
veewee-0.3.0.beta2 lib/veewee/provider/parallels/box/helper/ip.rb
veewee-0.3.0.beta1 lib/veewee/provider/parallels/box/helper/ip.rb
veewee-0.3.0.alpha9 lib/veewee/provider/parallels/box/helper/ip.rb
veewee-0.3.0.alpha8 lib/veewee/provider/parallels/box/helper/ip.rb
veewee-0.3.0.alpha7 lib/veewee/provider/parallels/box/helper/ip.rb
veewee-0.3.0.alpha6 lib/veewee/provider/parallels/box/helper/ip.rb
veewee-0.3.0.alpha5 lib/veewee/provider/parallels/box/helper/ip.rb