#!/bin/sh #Define the IPv6 Link Local addresses of the known Alfred Masters masters="fe80::ff:feee:1 fe80::ff:feee:3" if [ "$1" != "" ]; then interface="$1" else echo "Please provide an interface for tcpdump as argument." echo "For Example bat0" exit fi tcpdump -i $interface -l ip6 multicast and udp and port 16962 and ether[62:1] = 0x01 | awk '{print $3}' | awk -F '.' '{print $1}' | while read linklocal; do masterfound=0 for master in $masters do if [ "$linklocal" = "$master" ]; then echo "$linklocal is in the list of masters $masters" masterfound=1 break fi done if [ ! $masterfound ]; then echo "Undefined Master $linklocal on $interface should be one of $masters" fi done