From a75914fbe13ebddf8963ede8ba5a8c8757bd9f80 Mon Sep 17 00:00:00 2001 From: yancy ribbens Date: Sat, 12 Jan 2019 13:03:23 -0600 Subject: [PATCH] enable btct and btcctl mainnet to be invoked from docker --- docker/btcd/start-btcctl.sh | 21 ++++++++++++++------- docker/btcd/start-btcd.sh | 8 ++++++-- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/docker/btcd/start-btcctl.sh b/docker/btcd/start-btcctl.sh index e693d49d..7ff1aefb 100755 --- a/docker/btcd/start-btcctl.sh +++ b/docker/btcd/start-btcctl.sh @@ -43,10 +43,17 @@ RPCUSER=$(set_default "$RPCUSER" "devuser") RPCPASS=$(set_default "$RPCPASS" "devpass") NETWORK=$(set_default "$NETWORK" "simnet") -exec btcctl \ - "--$NETWORK" \ - --rpccert="/rpc/rpc.cert" \ - --rpcuser="$RPCUSER" \ - --rpcpass="$RPCPASS" \ - --rpcserver="rpcserver" \ - "$@" +PARAMS="" +if [ "$NETWORK" != "mainnet" ]; then + PARAMS=$(echo --$NETWORK) +fi + +PARAMS=$(echo $PARAMS \ + "--rpccert=/rpc/rpc.cert" \ + "--rpcuser=$RPCUSER" \ + "--rpcpass=$RPCPASS" \ + "--rpcserver=rpcserver" \ +) + +PARAMS="$PARAMS $@" +exec btcctl $PARAMS diff --git a/docker/btcd/start-btcd.sh b/docker/btcd/start-btcd.sh index 732b5a62..9ef605ae 100755 --- a/docker/btcd/start-btcd.sh +++ b/docker/btcd/start-btcd.sh @@ -44,8 +44,12 @@ RPCPASS=$(set_default "$RPCPASS" "devpass") DEBUG=$(set_default "$DEBUG" "info") NETWORK=$(set_default "$NETWORK" "simnet") -PARAMS=$(echo \ - "--$NETWORK" \ +PARAMS="" +if [ "$NETWORK" != "mainnet" ]; then + PARAMS=$(echo --$NETWORK) +fi + +PARAMS=$(echo $PARAMS \ "--debuglevel=$DEBUG" \ "--rpcuser=$RPCUSER" \ "--rpcpass=$RPCPASS" \