Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- echo "IP address | MAC address"
- for interface in `iw dev | grep Interface | cut -f 2 -s -d" "`
- do
- # for each interface, get mac addresses of connected stations/clients
- maclist=`iw dev $interface station dump | grep Station | cut -f 2 -s -d" "`
- # for each mac address in that list...
- for mac in $maclist
- do
- # extract ip from local arp table
- ip=$(arp | grep $mac | awk ' { print $1 } ')
- # found an ip tied to the mac address?
- if [ ! -z $ip ]; then
- # if found, print in the list
- echo "$ip | $mac"
- else
- echo "Not found into local arp table. Try another way..."
- fi;
- done
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement