From 29ad64d276057ecb74dc2b222de2cfeeaa7f3e4e Mon Sep 17 00:00:00 2001 From: andreas Date: Thu, 31 Jan 2008 17:17:48 +0000 Subject: rename --- plugins/facter/facterinterfaces.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 plugins/facter/facterinterfaces.rb (limited to 'plugins/facter/facterinterfaces.rb') diff --git a/plugins/facter/facterinterfaces.rb b/plugins/facter/facterinterfaces.rb new file mode 100755 index 0000000..4bf10bc --- /dev/null +++ b/plugins/facter/facterinterfaces.rb @@ -0,0 +1,13 @@ +# return the set of active interfaces as an array +Facter.add("facterinterfaces") do + setcode do + `ip -o link show`.split(/\n/).collect do |line| + value = nil + matches = line.match(/^\d*: ([^:]*): <(.*,)?UP(,.*)?>/) + if !matches.nil? + value = matches[1] + end + value + end.compact.sort.join(" ") + end +end -- cgit v1.2.3