diff --git a/bin/libbfa.sh b/bin/libbfa.sh index b5d1de5e280edd9a1a13723ec1d75690e7befae3..7c125c30be267407a021c38a2fe3800da273822c 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 b49303d9245acb5c0c6e99ba04ccdcf9b66fa609..d9807b97d27f5ec6c0eaf4cd541649a352c51f56 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