Created
March 23, 2012 19:20
-
-
Save ggolin/2174061 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
#!/usr/bin/ruby | |
kmodule = 'ixgbe' | |
modules = '/proc/modules' | |
min_version = '3' | |
exit_code = 0 | |
kmodule_version = %x{ modinfo -F version #{kmodule} } if %x{ grep #{kmodule} #{modules} }.to_str[/#{kmodule}/] | |
unless kmodule_version.nil? | |
puts "<<<#{kmodule}_version>>>" | |
if kmodule_version.split('.')[0] < min_version | |
puts "#{kmodule} version is #{kmodule_version.chomp}! (Lowest major version allowed: #{min_version})" | |
exit_code = 2 | |
else | |
puts "#{kmodule} version is #{kmodule_version}" | |
end | |
end | |
exit(exit_code) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment