Commit 1f9076be authored by sdrfnord's avatar sdrfnord

Optimized gen_random_valid_mac.

* Improved finding of the manuf file.
parent f8e5d5f4
......@@ -3,9 +3,15 @@
# @license GPLv3+
# Generate random but valid mac address for certain vendors.
# Too slow ;)
# wireshark_manuf_file="`locate wireshark-manuf`"
wireshark_manuf_file="$HOME/Downloads/db/wireshark-manuf"
wireshark_manuf_file="/usr/share/wireshark/manuf"
if [ ! -r "$wireshark_manuf_file" ]; then
wireshark_manuf_file="`locate --regexp 'wireshark/manuf$' --limit 1`"
if [ ! -r "$wireshark_manuf_file" ]; then
echo "manuf file not found." 1>&2
exit 1
fi
fi
rand_mac_line=`grep -v '^#' "$wireshark_manuf_file"| \
grep -P ' (Intl|Hwlett-|Fujitsu) ' \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment