diff --git a/src/sniffer.py b/src/sniffer.py index b67df16..2ec9865 100644 --- a/src/sniffer.py +++ b/src/sniffer.py @@ -5,7 +5,11 @@ def run_cmd(cmd, out=subprocess.PIPE, timeout=None): # Just runs a command, supports changing the pipe n stuff proc = subprocess.Popen(cmd, stdout = out, stderr = subprocess.PIPE, shell=True) - proc.wait(timeout=timeout) + + try: + proc.wait(timeout=timeout) + except subprocess.TimeoutExpired: + return ("","",-1) return (proc.stdout.read().decode(), proc.stderr.read().decode(), proc.returncode) @@ -44,10 +48,6 @@ class Sniffer: if code != 0: return code - #time.sleep(timeout+.1) # Give a bit of time for airodump to write - - #stdout, code = run_cmd(f"killall -i airodump-ng") - full_filepath = f"{dump_file}-01.csv" return self.parse_sniff(full_filepath)