Advertisement
Guest User

Untitled

a guest
Feb 16th, 2020
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.39 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. for int in `ip -o link | cut -f 2 -d" " | cut -f 1 -d:`; do
  4.  
  5.  echo "====================="
  6.  echo Interface $int
  7.  mac=`ip link show ${int} | grep link/ether | tr -s " " | cut -f 3 -d" "`
  8.  if ( test $int = "lo" ) then
  9.   mac="--loopback--"
  10.  fi
  11.  echo HW $mac
  12.  macprefix=`echo ${mac} | tr ":" "." | cut -f 1-3 -d.`
  13.  cat /var/lib/ieee-data/oui.txt | grep -i " ${macprefix}"
  14.  
  15. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement