I'm new to perl, I'm trying to create a script that will capture tcpdump data into a specified file. So far i've been able to run the command just fine, however i don't know how to stop the process after a certain period of time. Say I want to capture 30 seconds of tcpdump data, how do I stop the tcpdump proccess after 30 seconds and continue with the script?
This is the first snippet of code i'm using to capture the data.
system ("/usr/sbin/tcpdump -npti eth0 > m2k.txt")
This is the first snippet of code i'm using to capture the data.
system ("/usr/sbin/tcpdump -npti eth0 > m2k.txt")