Class: Inspec::Resources::Interfaces::LinuxInterfaceLister

Inherits:
InterfaceLister
  • Object
show all
Defined in:
lib/inspec/resources/interfaces.rb

Instance Attribute Summary

Attributes inherited from InterfaceLister

#inspec

Instance Method Summary collapse

Methods inherited from InterfaceLister

#initialize

Constructor Details

This class inherits a constructor from Inspec::Resources::Interfaces::InterfaceLister

Instance Method Details

#scan_interfacesObject



90
91
92
93
94
95
96
97
# File 'lib/inspec/resources/interfaces.rb', line 90

def scan_interfaces
  iface_data = []
  cmd = inspec.command("ls /sys/class/net")
  cmd.stdout.split("\n").each do |iface|
    iface_data << { "name" => iface }
  end
  iface_data
end