Try to combine some if statements

This commit is contained in:
deix
2017-08-28 19:13:04 +02:00
parent 101332316a
commit 383d09ff29
3 changed files with 7 additions and 11 deletions

View File

@@ -44,9 +44,8 @@ class Airmon(object):
p = Process('airmon-ng')
for line in p.stdout().split('\n'):
# Ignore blank/header lines
if len(line) == 0: continue
if line.startswith('Interface'): continue
if line.startswith('PHY'): continue
if len(line) == 0 or line.startswith('Interface') or line.startswith('PHY'):
continue
# Strip out interface information
fields = line.split("\t")
@@ -242,8 +241,8 @@ class Airmon(object):
if re.search('^ *PID', line):
hit_pids = True
continue
if not hit_pids: continue
if line.strip() == '': continue
if not hit_pids or line.strip() == '':
continue
match = re.search('^[ \t]*(\d+)[ \t]*([a-zA-Z0-9_\-]+)[ \t]*$', line)
if match:
# Found process to kill