File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,23 @@ determine_manufacturer () {
33
33
# EXCEPTION FOR SUSPECT PRODUCTS
34
34
[[ $address =~ ^FF:FF ]] && manufacturer=" SIG Unassigned or Noncompliant OEM"
35
35
36
+ # If no cache try if we have ieee-data
37
+ if [ -z " $manufacturer " ] ; then
38
+ _temp=$( echo ${address: 0: 8} | sed ' s/://gi' )
39
+ _found=false
40
+ local remote_result=' '
41
+ if [ ! ${_found} ] && [ -f /var/lib/ieee-data/oui.csv ] ; then
42
+ remote_result=$( egrep " ,${_temp} ," /var/lib/ieee-data/oui.csv | cut -d\, -f3)
43
+ _found=true
44
+ fi
45
+ if [ ! ${_found} ] && [ -f /usr/share/ieee-data/oui.csv ] ; then
46
+ remote_result=$( egrep " ,${_temp} ," /var/lib/ieee-data/oui.csv | cut -d\, -f3)
47
+ _found=true
48
+ fi
49
+ [ -n " $remote_result " ] && echo " ${address: 0: 8} $remote_result " >> .manufacturer_cache
50
+ manufacturer=" $remote_result "
51
+ fi
52
+
36
53
# IF CACHE DOES NOT EXIST, USE MACVENDORS.COM
37
54
if [ -z " $manufacturer " ]; then
38
55
local remote_result=$( curl -sL https://api.macvendors.com/${address: 0: 8} | grep -vi " error" | head -1 | sed ' s/[^A-Za-z ]//gi' )
@@ -48,4 +65,4 @@ determine_manufacturer () {
48
65
[ -z " $manufacturer " ] && manufacturer=" Unknown" && echo " ${address: 0: 8} Unknown" >> .manufacturer_cache
49
66
echo " $manufacturer "
50
67
fi
51
- }
68
+ }
You can’t perform that action at this time.
0 commit comments