mirror of
https://github.com/inspec/inspec
synced 2024-11-26 22:50:36 +00:00
small syntax fix to interface resource.
addresses #1828 Signed-off-by: Aaron Lippold <lippold@gmail.com>
This commit is contained in:
parent
3f7b049981
commit
eacae80649
1 changed files with 2 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
# encoding: utf-8
|
||||
# author: Christoph Hartmann
|
||||
# author: Dominik Richter
|
||||
# author: Aaron Lippold
|
||||
|
||||
require 'utils/convert'
|
||||
|
||||
|
@ -64,7 +65,7 @@ module Inspec::Resources
|
|||
class LinuxInterface < InterfaceInfo
|
||||
def interface_info(iface)
|
||||
# will return "[mtu]\n1500\n[type]\n1"
|
||||
cmd = inspec.command("find /sys/class/net/#{iface}/ -type f -maxdepth 1 -exec sh -c 'echo \"[$(basename {})]\"; cat {} || echo -n' \\;")
|
||||
cmd = inspec.command("find /sys/class/net/#{iface}/ -maxdepth 1 -type f -exec sh -c 'echo \"[$(basename {})]\"; cat {} || echo -n' \\;")
|
||||
return nil if cmd.exit_status.to_i != 0
|
||||
|
||||
# parse values, we only recieve values, therefore we threat them as keys
|
||||
|
|
Loading…
Reference in a new issue