copy latest random_mac() from weave script to bin/multiweave

This commit is contained in:
Matthias Radestock committed 2015-07-06 15:09:23 +01:00
1 parent cf7fff3da2
commit 80a232f44c
1 file changed
+1 -1
+1 -1
View File
@@ -23,7 +23,7 @@ random_mac() {
# In the first byte of the MAC, the 'multicast' bit should be
# clear and 'locally administered' bit should be set. All other
# bits should be random.
od -txC -An -N6 /dev/urandom | sed 's|^ ||;s| |:|;s|[0-3]:|2:|;s|[4-7]:|6:|;s|[89ab]:|a:|;s|[c-f]:|e:|;s| |:|g'
od -txC -An -N6 /dev/urandom | ( read a b c d e f && printf "%02x:$b:$c:$d:$e:$f" $((0x$a & ~1 | 2)) )
}
case "$1" in