forked from angryip/ipscan
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate-mac-vendors.sh
More file actions
executable file
·24 lines (21 loc) · 892 Bytes
/
update-mac-vendors.sh
File metadata and controls
executable file
·24 lines (21 loc) · 892 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
# This scripts downloads and optimizes IEEE MAC vendor list
SED_APP='sed'
if [ "$(uname)" = "Darwin" ]; then
# Mac users: bundled sed doesn't have -r
brew install gnu-sed
SED_APP='gsed'
fi
curl 'http://standards-oui.ieee.org/oui/oui.txt' |\
fgrep '(base 16)' | $SED_APP -r '
s/\r//g; s/ \(base 16\)\t\t//
s/,? ?(Inc)\.?$//I
s/(,|, | )(Ltd|CO,\.LTD|Limited|GmbH|LLC|A\/S|AB|AS|SAS|AG|KG|PLC|SRL|OY|Oy|BV|Nederland BV|SAN VE TIC)\.?$//Ig
s/(,|, | )(Co|Corp|Corporation|Company|Incorporated)\.?$//Ig
s/\(.+\)//
s/ (Electronics?|Technology|Technologies|Telecommunication|Communications?|Corporation|Systems|Solutions|International|Industry|Industries|Networks?|Holdings?|Device$) ?//Ig
s/ (Registration Authority| MobilityCommunication)//
s/SAMSUNG ELECTRO[- ]MECHANICS/Samsung/
' | cut -c -42 | sort \
> resources/mac-vendors.txt
wc -l resources/mac-vendors.txt