start-icmp 393 Bytes
Newer Older
1 2 3 4 5 6 7
#! /bin/sh
# dump igmp traffic to catch unreachables

. /etc/mp-rude/start.conf

# pick interface with default route
IF=`ip route get 158.38.62.1 | perl -ne 'print $1 if / dev (\w+) /'`
8 9 10
if test "$IF" != ""
  then
    tomidnight=$((`date --date 'tomorrow 00:00' +%s`-`date +%s` - 1))
11
    /usr/sbin/tcpdump -i $IF -G $tomidnight -W 1 -w ${logpath}/icmp-%F-%T.pcap icmp 2> ${logpath}/icmp.log
12
fi