```ruby
# 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]
  end
end

```

Make the fact work gracefully on systems that don't have FreeRADIUS installed
user
```ruby
# Grab the FreeRADIUS version from the output of radiusd -v
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

```
assistant