Created
April 2, 2017 18:55
-
-
Save sodejm/05f5f77157f9a128063ceb07c9cf90c5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Justin Soderberg | |
# Will download IEEE oui database and format it to be used with dhcpd(posix) in splunk | |
#download file | |
wget standards.ieee.org/develop/regauth/oui/oui.txt | |
#extract and format new file | |
grep -i '(hex)' oui.txt >> mod_oui.txt | |
sed -i 's/-/:/g' mod_oui.txt | |
#strip all commas and periods | |
sed -i 's/[,]/ /g' mod_oui.txt | |
sed -i 's/[.]/ /g' mod_oui.txt | |
#strip string " (hex) " | |
sed -i 's/ */,"/' mod_oui.txt | |
sed -i 's/(hex)//' mod_oui.txt | |
sed -i 's/[[:blank:]]//' mod_oui.txt | |
sed -i 's/[[:blank:]]//' mod_oui.txt | |
#delete co and ltd | |
sed -i 's/ co //g' mod_oui.txt | |
sed -i 's/ltd//g' mod_oui.txt | |
sed -i 's/ $//' mod_oui.txt | |
sed -i 's/$/"/' mod_oui.txt | |
#convert to lowercase | |
sed -i 's/\(.*\)/\L\1/' mod_oui.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment