lib/linux_admin/network_interface.rb
def reload
      @network_conf = {}
      begin
        ip_output = ip_show
      rescue NetworkInterfaceError
        return false
      end

      parse_ip4(ip_output)
      parse_ip6(ip_output, :global)
      parse_ip6(ip_output, :link)

      @network_conf[:mac] = parse_ip_output(ip_output, %r{link/ether}, 1)

      [4, 6].each do |version|
        @network_conf["gateway#{version}".to_sym] = parse_ip_output(ip_route(version), /^default/, 2)
      end
      true
    end
# Gathers current network information for this interface
#
# @return [Boolean] true if network information was gathered successfully
Gathers current network information for this interface
Gathers current network information for this interface
def reload
      @network_conf = {}
      begin
        ip_output = ip_show
      rescue NetworkInterfaceError
        return false
      end
      parse_ip4(ip_output)
      parse_ip6(ip_output, :global)
      parse_ip6(ip_output, :link)
      @network_conf[:mac] = parse_ip_output(ip_output, %r{link/ether}, 1)
      [4, 6].each do |version|
        @network_conf["gateway#{version}".to_sym] = parse_ip_output(ip_route(version), /^default/, 2)
      end
      true
    end
def reload @network_conf = { } begin ip_output = ip_show rescue NetworkInterfaceError return false end parse_ip4 ( ip_output ) parse_ip6 ( ip_output , :global ) parse_ip6 ( ip_output , :link ) @network_conf [ :mac ] = parse_ip_output ( ip_output , %r{ link/ether } , 1 ) [ 4 , 6 ] . each do | version | @network_conf [ "gateway#{version}" . to_sym ] = parse_ip_output ( ip_route ( version ) , / ^default / , 2 ) end true end
Gathers current network information for this interface
Gathers current network information for this interface
true if network information was gathered successfully
true if network information was gathered successfully
Boolean