Last active
December 20, 2015 04:49
-
-
Save jasperla/6073805 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Calls like this: | |
# Facter::Util::Resolution.exec("sysctl hw.physmem | cut -d'=' -f2") | |
# can now be made with: | |
# Facter::Util::BSD.sysctl("hw.physmem") | |
module Facter | |
module Util | |
module BSD | |
# Provides a consistent way of invoking sysctl(8) across various BSD platforms | |
# | |
# @param mib [String] the sysctl(8) MIB name | |
# | |
# @api private | |
def sysctl(mib) | |
Facter::Util::Resolution.exec("/sbin/sysctl -n #{mib}") | |
end | |
module_function :sysctl | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment