Sha256: 393af8453cd89f6cf43b9df871d8108f258f3ed0d34dd360d3621269ea366b1f

Contents?: true

Size: 842 Bytes

Versions: 31

Compression:

Stored size: 842 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

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

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
specinfra-2.7.0 lib/specinfra/command/linux/base/interface.rb
specinfra-2.6.0 lib/specinfra/command/linux/base/interface.rb
specinfra-2.5.0 lib/specinfra/command/linux/base/interface.rb
specinfra-2.4.5 lib/specinfra/command/linux/base/interface.rb
specinfra-2.4.4 lib/specinfra/command/linux/base/interface.rb
specinfra-2.4.3 lib/specinfra/command/linux/base/interface.rb
specinfra-2.4.2 lib/specinfra/command/linux/base/interface.rb
specinfra-2.4.1 lib/specinfra/command/linux/base/interface.rb
specinfra-2.4.0 lib/specinfra/command/linux/base/interface.rb
specinfra-2.3.2 lib/specinfra/command/linux/base/interface.rb
specinfra-2.3.1 lib/specinfra/command/linux/base/interface.rb
specinfra-2.3.0 lib/specinfra/command/linux/base/interface.rb
specinfra-2.2.4 lib/specinfra/command/linux/base/interface.rb
specinfra-2.2.3 lib/specinfra/command/linux/base/interface.rb
specinfra-2.2.2 lib/specinfra/command/linux/base/interface.rb
specinfra-2.2.1 lib/specinfra/command/linux/base/interface.rb
specinfra-2.2.0 lib/specinfra/command/linux/base/interface.rb
specinfra-2.1.1 lib/specinfra/command/linux/base/interface.rb
specinfra-2.1.0 lib/specinfra/command/linux/base/interface.rb
specinfra-2.0.4 lib/specinfra/command/linux/base/interface.rb