Sha256: 2d0d4d6b95ff4df63ec9c878288a89f6981f35978a61153b2a5dec666195958b
Contents?: true
Size: 555 Bytes
Versions: 6
Compression:
Stored size: 555 Bytes
Contents
module Serverspec module Type class DefaultGateway < Base def ipaddress ret = @runner.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 = @runner.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
6 entries across 6 versions & 1 rubygems