Sha256: e3b8fb6af15992bfd2fe0cfabd1b2651b7e3593ec85f108e29734e589ff531ce

Contents?: true

Size: 498 Bytes

Versions: 5

Compression:

Stored size: 498 Bytes

Contents

class Specinfra::Command::Linux::Base::Interface < Specinfra::Command::Base::Interface
  def get_speed_of(name)
    "ethtool #{name} | grep Speed | gawk '{print gensub(/Speed: ([0-9]+)Mb\\\/s/,\"\\\\1\",\"\")}'"
  end

  def check_ipv4_address(interface, ip_address)
    ip_address = ip_address.dup
    if ip_address =~ /\/\d+$/
      ip_address << " "
    else
      ip_address << "/"
    end
    ip_address.gsub!(".", "\\.")
    "ip addr show #{interface} | grep 'inet #{ip_address}'"
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
specinfra-2.0.0.beta11 lib/specinfra/command/linux/base/interface.rb
specinfra-2.0.0.beta10 lib/specinfra/command/linux/base/interface.rb
specinfra-2.0.0.beta9 lib/specinfra/command/linux/base/interface.rb
specinfra-2.0.0.beta8 lib/specinfra/command/linux/base/interface.rb
specinfra-2.0.0.beta7 lib/specinfra/command/linux/base/interface.rb