def sysctl(cmdline):
 result = sh(('sysctl ' + cmdline))
 if FREEBSD:
  result = result[(result.find(': ') + 2):]
 elif (OPENBSD or NETBSD):
  result = result[(result.find('=') + 1):]
 try:
  return int(result)
 except ValueError:
  return result

def sysctl ( cmdline ) : result = sh ( ( 'sysctl ' + cmdline ) ) if FREEBSD : result = result [ ( result . find ( ': ' ) + 2 ) : ] elif ( OPENBSD or NETBSD ) : result = result [ ( result . find ( '=' ) + 1 ) : ] try : return int ( result ) except ValueError : return result
require a kernel parameter to have a specific value .