From 5ac915b6a4c423431707628fad07644e8b05ac66 Mon Sep 17 00:00:00 2001 From: Robert Martin-Legene <robert@nic.ar> Date: Wed, 1 Aug 2018 23:39:53 -0300 Subject: [PATCH] Moved extradata into a separate function --- bin/libbfa.sh | 11 +++++++---- bin/start.sh | 3 +-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/bin/libbfa.sh b/bin/libbfa.sh index c6ed763..b5d1de5 100644 --- a/bin/libbfa.sh +++ b/bin/libbfa.sh @@ -188,14 +188,17 @@ function nodedir test -r "${BFANODEDIR}/rpcport" || echo $(( $RANDOM / 2 + 12345 )) > ${BFANODEDIR}/rpcport rpcport=$( cat ${BFANODEDIR}/rpcport ) +} + +function extradata +{ + account # something uniqueish ## find default interface 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}' ) - - BFAEXTRADATA="${USER}@${HOSTNAME}" - BFAEXTRADATA="${BFAEXTRADATA} " - BFAEXTRADATA="${BFAEXTRADATA:0:19} ${mymac}" + # + echo -n "${account:0:19} ${mymac:0:12}" } function account diff --git a/bin/start.sh b/bin/start.sh index 21d51e6..b49303d 100755 --- a/bin/start.sh +++ b/bin/start.sh @@ -61,7 +61,7 @@ function getsyncmode echo '***' echo # (re)configure parameters (you never know if they changed) - flexargs="$( accountlist) $( getminer ) $( getsyncmode )" + flexargs="$( accountlist) $( getminer ) $( getsyncmode ) --extradata $( extradata )" \ set -x geth \ --datadir ${BFANODEDIR} \ @@ -78,7 +78,6 @@ function getsyncmode --txpool.globalslots 32768 \ --txpool.accountqueue 512 \ --txpool.globalqueue 8192 \ - --extradata "${BFAEXTRADATA}" \ --gcmode archive \ --cache 512 \ --verbosity 3 & -- GitLab