Skip to content

Instantly share code, notes, and snippets.

@sodejm
Created April 2, 2017 18:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sodejm/05f5f77157f9a128063ceb07c9cf90c5 to your computer and use it in GitHub Desktop.
Save sodejm/05f5f77157f9a128063ceb07c9cf90c5 to your computer and use it in GitHub Desktop.
#!/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