Commit ba3ccd00 authored by Jonathan Gazeley's avatar Jonathan Gazeley
Browse files

Fix version number lookup on Ubuntu

parent 380ae1b1
# Grab the FreeRADIUS version from the output of radiusd -v
version = Facter::Core::Execution.exec('radiusd -v')
if version.nil?
version = Facter::Core::Execution.exec('freeradius -v')
# Set path to binary for our platform
dist = Facter.value(:osfamily)
case dist
when /RedHat/
binary = 'radiusd'
when /Debian/
binary = 'freeradius'
binary = 'radiusd'
# Execute call to fetch version info
version = Facter::Core::Execution.exec("#{binary} -v")
# Extract full version number
Facter.add(:freeradius_version) do
setcode do
if !version.nil?
......@@ -13,6 +24,7 @@ Facter.add(:freeradius_version) do
# Extract major version number
Facter.add(:freeradius_maj_version) do
setcode do
if !version.nil?
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment