From ef91ac5a1e677b0c59aaefb7d9d1e2eb6ef6d5ef Mon Sep 17 00:00:00 2001
From: Robert Martin-Legene <robert@nic.ar>
Date: Thu, 2 Aug 2018 00:19:35 -0300
Subject: [PATCH] extradata 'must' be a single string, the way we're storing it
 in a string before using it

---
 bin/libbfa.sh |  6 +++---
 bin/start.sh  | 10 +++++-----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/bin/libbfa.sh b/bin/libbfa.sh
index b5d1de5..7c125c3 100644
--- a/bin/libbfa.sh
+++ b/bin/libbfa.sh
@@ -46,9 +46,9 @@ function    geth_attach
 function    geth_exec_js
 {
     test    -r "$1"
-    if echo $- | grep -q x
+    if echo $- | grep -q x && [ -t 1 ]
     then
-        sed "s//input: /" "$1"
+        sed "s/^/input: /" "$1"
     fi
     geth_attach --exec "loadScript(\"$1\")" </dev/null
 }
@@ -198,7 +198,7 @@ function    extradata
     local def_if=$( ( ip -4 route show ; ip -6 route show ) | expand | sed -ne '/^default /{s/  */ /g;s/^.* dev //;s/ .*//;p;q}' )
     local mymac=$( ip link show ${def_if} | sed -ne '/link\|ether/{s/^.*link.ether //;s/ .*//;s/://g;p;q}' )
     #
-    echo -n "${account:0:19} ${mymac:0:12}"
+    echo -n "${account:0:19}.${mymac:0:12}"
 }
 
 function    account
diff --git a/bin/start.sh b/bin/start.sh
index b49303d..d9807b9 100755
--- a/bin/start.sh
+++ b/bin/start.sh
@@ -41,9 +41,9 @@ function getminer
 
 function getsyncmode
 {
-    local syncmode=$( cat "${BFANODEDIR}/syncmode" 2>/dev/null )
+    local syncmode=$( cat "${BFANODEDIR}/syncmode" 2>/dev/null || true )
     syncmode=${syncmode:-fast}
-    echo -- "--syncmode ${syncmode}"
+    echo "--syncmode ${syncmode}"
 }
 
 
@@ -61,11 +61,10 @@ function getsyncmode
         echo '***'
         echo
         # (re)configure parameters (you never know if they changed)
-	flexargs="$( accountlist) $( getminer ) $( getsyncmode ) --extradata $( extradata )"   \
+	flexargs="$( accountlist) $( getminer ) $( getsyncmode ) --extradata $( extradata )"
         set -x
         geth			            \
 	    --datadir ${BFANODEDIR}	    \
-	    ${flexargs}			    \
 	    --networkid $BFANETWORKID       \
 	    --bootnodes "${bootnodes}"      \
 	    --rpc			    \
@@ -80,7 +79,8 @@ function getsyncmode
             --txpool.globalqueue 8192       \
             --gcmode archive                \
 	    --cache 512		            \
-	    --verbosity 3			&
+	    --verbosity 3		    \
+	    ${flexargs}			    &
         set +x
         echo $! > ${BFANODEDIR}/geth.pid
         wait
-- 
GitLab