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
66212595
Commit
66212595
authored
Oct 27, 2014
by
Jonathan Gazeley
Browse files
Make the fact work gracefully on systems that don't have FreeRADIUS
installed
parent
4e5ddeba
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/facter/freeradius_version.rb
View file @
66212595
# Grab the FreeRADIUS version from the output of radiusd -v
Facter
.
add
(
:freeradius_version
)
do
setcode
do
Facter
::
Core
::
Execution
.
exec
(
'radiusd -v'
).
split
(
/\n/
)[
0
].
match
(
/FreeRADIUS Version (\d\.\d\.\d)/
)[
1
]
if
%x{which radiusd 2>/dev/null | wc -l}
.
chomp
.
to_i
>
0
Facter
.
add
(
:freeradius_version
)
do
setcode
do
Facter
::
Core
::
Execution
.
exec
(
'radiusd -v'
).
split
(
/\n/
)[
0
].
match
(
/FreeRADIUS Version (\d\.\d\.\d)/
)[
1
]
end
end
end
Write
Preview
Supports
Markdown
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