There is really no reason (except for single-wifi computers) for the tshark scanning to stop. I would like to implement a thread for the tshark scanning and then have the output parsed directly from the log file.
The two files are to ensure that the data will rollover and not get overwritten. Both files can be read by the python script and determined accordingly.
In Python3, this can be implemented:
# Run tshark in the background
ls_output=subprocess.Popen("/usr/bin/tshark -I -i wlan1 -b files:2 -b filesize:10000 -w /tmp/temp".split(), stdout=subprocess.PIPE,stderr=subprocess.PIPE)
# Check if its running
ls_output1=subprocess.Popen("ps aux".split(), stdout=subprocess.PIPE,stderr=subprocess.PIPE)
output = ls_output1.stdout.read()
isRunning = "tshark" in output and "[tshark] <defunct>" not in output
There is really no reason (except for single-wifi computers) for the tshark scanning to stop. I would like to implement a thread for the tshark scanning and then have the output parsed directly from the log file.
Command for scanning, something like:
Then, to read:
The two files are to ensure that the data will rollover and not get overwritten. Both files can be read by the python script and determined accordingly.
In Python3, this can be implemented: