From 80a232f44c1047557d2d55468dffd8774603c9f8 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Mon, 6 Jul 2015 15:09:23 +0100 Subject: [PATCH] copy latest random_mac() from weave script to bin/multiweave --- bin/multiweave | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/multiweave b/bin/multiweave index 1dd5dfd8..6a78230a 100755 --- a/bin/multiweave +++ b/bin/multiweave @@ -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