Class: Inspec::Resources::Interfaces::BsdInterfaceLister
- Inherits:
-
InterfaceLister
- Object
- InterfaceLister
- Inspec::Resources::Interfaces::BsdInterfaceLister
- Defined in:
- lib/inspec/resources/interfaces.rb
Instance Attribute Summary
Attributes inherited from InterfaceLister
Instance Method Summary collapse
Methods inherited from InterfaceLister
Constructor Details
This class inherits a constructor from Inspec::Resources::Interfaces::InterfaceLister
Instance Method Details
#scan_interfaces ⇒ Object
75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/inspec/resources/interfaces.rb', line 75 def scan_interfaces iface_data = [] cmd = inspec.command("ifconfig -a") cmd.stdout.split("\n").each do |line| # lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384 m = line.match(/^(\S+):/) if m iface_data << { "name" => m[1] } end end iface_data end |