renamed time parameter to timeout to avoid collision with time package

This commit is contained in:
Michael Scalzetti 2022-10-26 03:10:37 -04:00
parent ddfe6db7bb
commit c3cebbd6c9

View File

@ -38,15 +38,15 @@ class Sniffer:
return code == 0 return code == 0
def sniff(self, time): def sniff(self, timeout):
time = int(time+0.5) timeout = int(timeout+0.5)
dump_file = f"{self.base_dir}/cap-{ int(time.time()) }" dump_file = f"{self.base_dir}/cap-{ int(time.time()) }"
stdout, code = run_cmd(f"airodump-ng --write {dump_file} --write-interval 1 --output-format csv walfa0") stdout, code = run_cmd(f"airodump-ng --write {dump_file} --write-interval 1 --output-format csv walfa0")
if code != 0: if code != 0:
return code return code
time.sleep(time+.1) # Give a bit of time for airodump to write time.sleep(timeout+.1) # Give a bit of time for airodump to write
stdout, code = run_cmd(f"killall -i airodump-ng") stdout, code = run_cmd(f"killall -i airodump-ng")