Commit 8605c6cd authored by Jonathan Gazeley's avatar Jonathan Gazeley
Browse files

Merge branch 'master' into drop_support_for_fr2

parents 7cf9d8d4 3fccbcc3
# Grab the FreeRADIUS version from the output of radiusd -v
Facter.add(:freeradius_maj_version) do
setcode do
version = Facter::Core::Execution.exec('radiusd -v')
if version.nil?
version = Facter::Core::Execution.exec('freeradius -v')
end
if !version.nil?
version = version.split(/\n/)[0].match(/FreeRADIUS Version (\d)\.\d\.\d/)[1].to_s
end
version
end
end
# Grab the FreeRADIUS version from the output of radiusd -v # 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')
end
Facter.add(:freeradius_version) do Facter.add(:freeradius_version) do
setcode do setcode do
version = Facter::Core::Execution.exec('radiusd -v')
if version.nil?
version = Facter::Core::Execution.exec('freeradius -v')
end
if !version.nil? if !version.nil?
version = version.split(/\n/)[0].match(/FreeRADIUS Version (\d\.\d\.\d)/)[1].to_s minver = version.split(/\n/)[0].match(/FreeRADIUS Version (\d\.\d\.\d)/)[1].to_s
end end
version minver
end end
end end
Facter.add(:freeradius_maj_version) do
setcode do
if !version.nil?
majver = version.split(/\n/)[0].match(/FreeRADIUS Version (\d)\.\d\.\d/)[1].to_s
end
majver
end
end
Supports Markdown
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