master-thesis/p4app/sniff-host.sh

21 lines
276 B
Bash
Raw Normal View History

2019-03-21 20:36:01 +01:00
#!/bin/sh
2019-03-21 20:37:25 +01:00
if [ $# -ne 2 ]; then
echo "$0 host name"
exit 1
fi
2019-03-21 20:36:01 +01:00
set -x
2019-03-21 20:37:25 +01:00
2019-03-21 20:36:01 +01:00
host=$1
name=$2
now=$(date +%F-%H%M)
2019-03-21 20:39:42 +01:00
filename=${name}-${now}-${host}.pcap
2019-03-21 20:36:01 +01:00
intf=${host}-eth0
mx "$host" tcpdump -ni ${intf} -w "${filename}"
2019-03-23 14:33:50 +01:00
git add .
git commit -m "+pcap: ${filename}"
git push