Sha256: d5d8f3b27ca0a9ef16ae5d58f491c1c26dcab13b59c8e5319d48959a0fdd4451

Contents?: true

Size: 549 Bytes

Versions: 77

Compression:

Stored size: 549 Bytes

Contents

module Serverspec
  module Type
    class DefaultGateway < Base
      def ipaddress
        ret = backend.run_command(commands.check_routing_table('default'))
        ret[:stdout] =~ /^(\S+)(?: via (\S+))? dev (\S+).+\r\n(?:default via (\S+))?/
        $2 ? $2 : $4
      end

      def interface
        ret = backend.run_command(commands.check_routing_table('default'))
        ret[:stdout] =~ /^(\S+)(?: via (\S+))? dev (\S+).+\r\n(?:default via (\S+))?/
        $3
      end

      def to_s
        'Default Gateway'
      end
    end
  end
end

Version data entries

77 entries across 77 versions & 1 rubygems

Version Path
serverspec-0.10.0 lib/serverspec/type/default_gateway.rb
serverspec-0.9.8 lib/serverspec/type/default_gateway.rb
serverspec-0.9.7 lib/serverspec/type/default_gateway.rb
serverspec-0.9.6 lib/serverspec/type/default_gateway.rb
serverspec-0.9.5 lib/serverspec/type/default_gateway.rb
serverspec-0.9.4 lib/serverspec/type/default_gateway.rb
serverspec-0.9.3 lib/serverspec/type/default_gateway.rb
serverspec-0.9.2 lib/serverspec/type/default_gateway.rb
serverspec-0.9.1 lib/serverspec/type/default_gateway.rb
serverspec-0.9.0 lib/serverspec/type/default_gateway.rb
serverspec-0.8.1 lib/serverspec/type/default_gateway.rb
serverspec-0.8.0 lib/serverspec/type/default_gateway.rb
serverspec-0.7.13 lib/serverspec/type/default_gateway.rb
serverspec-0.7.12 lib/serverspec/type/default_gateway.rb
serverspec-0.7.11 lib/serverspec/type/default_gateway.rb
serverspec-0.7.10 lib/serverspec/type/default_gateway.rb
serverspec-0.7.9 lib/serverspec/type/default_gateway.rb
serverspec-0.7.8 lib/serverspec/type/default_gateway.rb
serverspec-0.7.7 lib/serverspec/type/default_gateway.rb
serverspec-0.7.6 lib/serverspec/type/default_gateway.rb