Normalise the module name when comparing against the module names in /proc/modules.

This commit is contained in:
Matt Jeffery 2014-02-20 16:50:09 +00:00 committed by Matt Jeffery
parent 125e9d4703
commit 8131feaade

View file

@ -60,8 +60,9 @@ def main():
try:
modules = open('/proc/modules')
present = False
module_name = args['name'].replace('-', '_') + ' '
for line in modules:
if line.startswith(args['name'] + ' '):
if line.startswith(module_name):
present = True
break
modules.close()