Add cleanup message and option to keep temporary pcap file
- Show message when deleting temporary pcap file - Add KEEP_PCAP environment variable option to keep the file for analysis Usage: KEEP_PCAP=1 sudo ./test_monitor_tshark.sh wlan0 36 10 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
84a16cf62b
commit
73358f9223
|
|
@ -161,8 +161,13 @@ CAPTURE_OUTPUT=$(tshark -q -r "$TEMP_PCAP" -n -T fields \
|
||||||
-e radiotap.present \
|
-e radiotap.present \
|
||||||
2>/dev/null || true)
|
2>/dev/null || true)
|
||||||
|
|
||||||
# Clean up temp file
|
# Clean up temp file (unless KEEP_PCAP is set)
|
||||||
|
if [ -z "${KEEP_PCAP:-}" ]; then
|
||||||
|
echo "Cleaning up temporary pcap file: $TEMP_PCAP"
|
||||||
rm -f "$TEMP_PCAP"
|
rm -f "$TEMP_PCAP"
|
||||||
|
else
|
||||||
|
echo "Keeping temporary pcap file: $TEMP_PCAP"
|
||||||
|
fi
|
||||||
|
|
||||||
# Force output flush
|
# Force output flush
|
||||||
sync
|
sync
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue