Sha256: 21accf39db1d1b19a2794ca304783934a7fe2e63a5e754fb4abc4001a7232668

Contents?: true

Size: 550 Bytes

Versions: 30

Compression:

Stored size: 550 Bytes

Contents

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

    def check_has_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
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
specinfra-2.0.0.beta45 lib/specinfra/command/linux/base/interface.rb
specinfra-2.0.0.beta44 lib/specinfra/command/linux/base/interface.rb
specinfra-2.0.0.beta43 lib/specinfra/command/linux/base/interface.rb
specinfra-2.0.0.beta42 lib/specinfra/command/linux/base/interface.rb
specinfra-2.0.0.beta41 lib/specinfra/command/linux/base/interface.rb
specinfra-2.0.0.beta40 lib/specinfra/command/linux/base/interface.rb
specinfra-2.0.0.beta39 lib/specinfra/command/linux/base/interface.rb
specinfra-2.0.0.beta38 lib/specinfra/command/linux/base/interface.rb
specinfra-2.0.0.beta37 lib/specinfra/command/linux/base/interface.rb
specinfra-2.0.0.beta36 lib/specinfra/command/linux/base/interface.rb
specinfra-2.0.0.beta35 lib/specinfra/command/linux/base/interface.rb
specinfra-2.0.0.beta34 lib/specinfra/command/linux/base/interface.rb
specinfra-2.0.0.beta33 lib/specinfra/command/linux/base/interface.rb
specinfra-2.0.0.beta32 lib/specinfra/command/linux/base/interface.rb
specinfra-2.0.0.beta31 lib/specinfra/command/linux/base/interface.rb
specinfra-2.0.0.beta30 lib/specinfra/command/linux/base/interface.rb
specinfra-2.0.0.beta29 lib/specinfra/command/linux/base/interface.rb
specinfra-2.0.0.beta28 lib/specinfra/command/linux/base/interface.rb
specinfra-2.0.0.beta27 lib/specinfra/command/linux/base/interface.rb
specinfra-2.0.0.beta26 lib/specinfra/command/linux/base/interface.rb