SYNC
This commit is contained in:
@@ -65,10 +65,14 @@ def handle_capture_metadata():
|
||||
return device_id
|
||||
|
||||
|
||||
def handle_date_dir():
|
||||
pass
|
||||
|
||||
def run_tcpdum(cmd):
|
||||
subprocess.run(cmd)
|
||||
def handle_sniff(args):
|
||||
if not cwd_is_device_root_dir():
|
||||
handle_metadata()
|
||||
else:
|
||||
if cwd_is_device_root_dir():
|
||||
handle_date_dir()
|
||||
cmd = ['sudo tcpdump', '-i', args.capture_interface]
|
||||
if args.monitor_mode:
|
||||
cmd.append('-I')
|
||||
@@ -87,7 +91,7 @@ def handle_sniff(args):
|
||||
# TODO maybe dump this into file -> put into device metadata
|
||||
try:
|
||||
start_time = datetime.now().strftime('%H:%M:%S')
|
||||
subprocess.run(cmd)
|
||||
run_tcpdum(cmd)
|
||||
stop_time = datetime.now().strftime('%H:%M:%S')
|
||||
except KeyboardInterrupt:
|
||||
print("Received keyboard interrupt.")
|
||||
@@ -100,3 +104,8 @@ def handle_sniff(args):
|
||||
exit(ReturnCodes.FAILURE)
|
||||
|
||||
return ReturnCodes.SUCCESS
|
||||
else:
|
||||
handle_metadata()
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user