Fix the tcpdump start issue.
[csit.git] / nsh_sfc_tests / sfc_scripts / start_tcpdump.sh
1 #!/bin/bash
2
3 ROOTDIR=/tmp/openvpp-testing
4 PWDDIR=$(pwd)
5
6 cd ${ROOTDIR}/nsh_sfc_tests/sfc_scripts/
7 sudo rm -f temp_packet.pcap
8
9 sudo /usr/sbin/tcpdump -i $1 -c 1 -w temp_packet.pcap dst host $2 &
10
11 if [ ! $? -eq 0 ]; then
12     echo "Start the tcpdump failed!!!"
13     exit 1
14 fi
15
16 cd ${PWDDIR}