Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
puppet-freeradius
Commits
ba3ccd00
Commit
ba3ccd00
authored
May 27, 2016
by
Jonathan Gazeley
Browse files
Fix version number lookup on Ubuntu
parent
380ae1b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/facter/freeradius_version.rb
View file @
ba3ccd00
# 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'
else
binary
=
'radiusd'
end
# 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
end
end
# Extract major version number
Facter
.
add
(
:freeradius_maj_version
)
do
setcode
do
if
!
version
.
nil?
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment