diff --git a/scripts/install_bitcoind.sh b/scripts/install_bitcoind.sh index f9047ab1..51c488ba 100755 --- a/scripts/install_bitcoind.sh +++ b/scripts/install_bitcoind.sh @@ -1,16 +1,18 @@ -#!/usr/env bash +#!/usr/bin/env bash + +set -ev export BITCOIND_VERSION=0.17.1 if sudo cp ~/bitcoin/bitcoin-$BITCOIND_VERSION/bin/bitcoind /usr/local/bin/bitcoind -then echo "bitcoind installed" +then + echo "found cached bitcoind" else mkdir -p ~/bitcoin && \ - pushd ~/bitcoin && \ - wget https://bitcoin.org/bin/bitcoin-core-$BITCOIND_VERSION/bitcoin-$BITCOIND_VERSION-x86_64-linux-gnu.tar.gz && \ - tar xvfz bitcoin-$BITCOIND_VERSION-x86_64-linux-gnu.tar.gz && \ - sudo cp ./bitcoin-$BITCOIND_VERSION/bin/bitcoind - /usr/local/bin/bitcoind && \ - popd + pushd ~/bitcoin && \ + wget https://bitcoin.org/bin/bitcoin-core-$BITCOIND_VERSION/bitcoin-$BITCOIND_VERSION-x86_64-linux-gnu.tar.gz && \ + tar xvfz bitcoin-$BITCOIND_VERSION-x86_64-linux-gnu.tar.gz && \ + sudo cp ./bitcoin-$BITCOIND_VERSION/bin/bitcoind /usr/local/bin/bitcoind && \ + popd fi