filter log/ filenames into sw.command
[dell-switch] / find-port-for-mac
1 #!/bin/sh -e
2
3 test -z "$1" && echo "Usage: $0 d4:ca:6d:01:4c:f2" && exit 1
4
5 mac=$1
6
7 . ./shm-trunk.regex
8
9 grep -r -i $mac /dev/shm/snmp-mac-port/ | tee /dev/shm/mac.$mac | grep --file /dev/shm/trunk.regex -v | cut -d: -f2-
10 echo "# mac $mac on "`cat /dev/shm/mac.$mac | cut -d: -f2- | cut -d' ' -f1 | sort -u | wc -l`" switches"