Commit fb43dfd2 authored by Jonathon Duerig's avatar Jonathon Duerig

Added exit trapping which should now properly close tcpdump sessions. Untested.

parent 7af26ef3
......@@ -2,6 +2,19 @@
# Usage: run-client.sh <dest1-ip> <dest2-ip> <port> <base-path> <output-file> <duration>
echo sudo /usr/sbin/tcpdump -n -tt -i vnet dst port $3 | perl $4/glean.pl > /local/logs/$5
sudo /usr/sbin/tcpdump -n -tt -i vnet dst port $3 | perl $4/glean.pl > /local/logs/$5 &
DUMPPID=$!
echo $4/iperf -c $1 -p $3 -t $6
$4/iperf -c $1 -p $3 -t $6&
$4/iperf -c $2 -p $3 -t $6
FIRSTPID=$!
echo $4/iperf -c $2 -p $3 -t $6
$4/iperf -c $2 -p $3 -t $6&
SECONDPID=$!
trap "sudo kill $DUMPPID; sudo kill $FIRSTPID; sudo kill $SECONDPID" EXIT
wait
exit 0
......@@ -2,5 +2,14 @@
# Usage: run-server.sh <port> <base-path> <output-file>
echo sudo /usr/sbin/tcpdump -n -tt -i vnet dst port $1 | perl $2/glean.pl > /local/logs/$3
sudo /usr/sbin/tcpdump -n -tt -i vnet dst port $1 | perl $2/glean.pl > /local/logs/$3 &
$2/iperf -s -p $1
DUMPPID=$!
echo $2/iperf -s -p $1
$2/iperf -s -p $1 &
IPERFPID=$!
trap "sudo kill $DUMPPID; sudo kill $IPERFPID" EXIT
wait
exit 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment