diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/facter/shorewall_version.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/facter/shorewall_version.rb b/lib/facter/shorewall_version.rb new file mode 100644 index 0000000..9c53ec2 --- /dev/null +++ b/lib/facter/shorewall_version.rb @@ -0,0 +1,10 @@ +Facter.add("shorewall_major_version") do + setcode do + shorewall_version = Facter::Util::Resolution.exec('shorewall version') + if shorewall_version != nil + shorewall_major_version = shorewall_version.split('.').first + else + shorewall_major_version = '-1' + end + end +end |