Skip to content
Snippets Groups Projects
Commit ef91ac5a authored by Robert Martin-Legene's avatar Robert Martin-Legene
Browse files

extradata 'must' be a single string, the way we're storing it in a string before using it

parent b3326343
No related branches found
No related tags found
No related merge requests found
...@@ -46,9 +46,9 @@ function geth_attach ...@@ -46,9 +46,9 @@ function geth_attach
function geth_exec_js function geth_exec_js
{ {
test -r "$1" test -r "$1"
if echo $- | grep -q x if echo $- | grep -q x && [ -t 1 ]
then then
sed "s//input: /" "$1" sed "s/^/input: /" "$1"
fi fi
geth_attach --exec "loadScript(\"$1\")" </dev/null geth_attach --exec "loadScript(\"$1\")" </dev/null
} }
...@@ -198,7 +198,7 @@ function extradata ...@@ -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 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}' ) 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 function account
......
...@@ -41,9 +41,9 @@ function getminer ...@@ -41,9 +41,9 @@ function getminer
function getsyncmode function getsyncmode
{ {
local syncmode=$( cat "${BFANODEDIR}/syncmode" 2>/dev/null ) local syncmode=$( cat "${BFANODEDIR}/syncmode" 2>/dev/null || true )
syncmode=${syncmode:-fast} syncmode=${syncmode:-fast}
echo -- "--syncmode ${syncmode}" echo "--syncmode ${syncmode}"
} }
...@@ -61,11 +61,10 @@ function getsyncmode ...@@ -61,11 +61,10 @@ function getsyncmode
echo '***' echo '***'
echo echo
# (re)configure parameters (you never know if they changed) # (re)configure parameters (you never know if they changed)
flexargs="$( accountlist) $( getminer ) $( getsyncmode ) --extradata $( extradata )" \ flexargs="$( accountlist) $( getminer ) $( getsyncmode ) --extradata $( extradata )"
set -x set -x
geth \ geth \
--datadir ${BFANODEDIR} \ --datadir ${BFANODEDIR} \
${flexargs} \
--networkid $BFANETWORKID \ --networkid $BFANETWORKID \
--bootnodes "${bootnodes}" \ --bootnodes "${bootnodes}" \
--rpc \ --rpc \
...@@ -80,7 +79,8 @@ function getsyncmode ...@@ -80,7 +79,8 @@ function getsyncmode
--txpool.globalqueue 8192 \ --txpool.globalqueue 8192 \
--gcmode archive \ --gcmode archive \
--cache 512 \ --cache 512 \
--verbosity 3 & --verbosity 3 \
${flexargs} &
set +x set +x
echo $! > ${BFANODEDIR}/geth.pid echo $! > ${BFANODEDIR}/geth.pid
wait wait
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment