From 5c18d1fc7951b901eca57b3a13eef6011ae0c9b1 Mon Sep 17 00:00:00 2001 From: Miller Date: Mon, 13 Dec 2021 18:39:20 -0500 Subject: [PATCH] bitcoin-cli: enable bash-completion (#608) --- rootfs/standard/usr/bin/mynode_post_upgrade.sh | 5 +++++ setup/setup_device.sh | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/rootfs/standard/usr/bin/mynode_post_upgrade.sh b/rootfs/standard/usr/bin/mynode_post_upgrade.sh index 6e92801e..5c918daa 100755 --- a/rootfs/standard/usr/bin/mynode_post_upgrade.sh +++ b/rootfs/standard/usr/bin/mynode_post_upgrade.sh @@ -273,6 +273,7 @@ fi BTC_UPGRADE_URL=https://bitcoincore.org/bin/bitcoin-core-$BTC_VERSION/bitcoin-$BTC_VERSION-$ARCH.tar.gz BTC_UPGRADE_SHA256SUM_URL=https://bitcoincore.org/bin/bitcoin-core-$BTC_VERSION/SHA256SUMS BTC_UPGRADE_SHA256SUM_ASC_URL=https://bitcoincore.org/bin/bitcoin-core-$BTC_VERSION/SHA256SUMS.asc +BTC_CLI_COMPLETION_URL=https://raw.githubusercontent.com/bitcoin/bitcoin/v$BTC_VERSION/contrib/bitcoin-cli.bash-completion CURRENT="" if [ -f $BTC_VERSION_FILE ]; then CURRENT=$(cat $BTC_VERSION_FILE) @@ -298,6 +299,10 @@ if [ "$CURRENT" != "$BTC_VERSION" ]; then # Mark current version echo $BTC_VERSION > $BTC_VERSION_FILE + + # Install bash-completion for bitcoin-cli + wget $BTC_CLI_COMPLETION_URL -O bitcoin-cli.bash-completion + sudo cp bitcoin-cli.bash-completion /etc/bash_completion.d/bitcoin-cli else echo "ERROR UPGRADING BITCOIN - GPG FAILED" fi diff --git a/setup/setup_device.sh b/setup/setup_device.sh index 411d305d..95c4e331 100755 --- a/setup/setup_device.sh +++ b/setup/setup_device.sh @@ -329,6 +329,7 @@ fi BTC_UPGRADE_URL=https://bitcoincore.org/bin/bitcoin-core-$BTC_VERSION/bitcoin-$BTC_VERSION-$ARCH.tar.gz BTC_UPGRADE_SHA256SUM_URL=https://bitcoincore.org/bin/bitcoin-core-$BTC_VERSION/SHA256SUMS BTC_UPGRADE_SHA256SUM_ASC_URL=https://bitcoincore.org/bin/bitcoin-core-$BTC_VERSION/SHA256SUMS.asc +BTC_CLI_COMPLETION_URL=https://raw.githubusercontent.com/bitcoin/bitcoin/v$BTC_VERSION/contrib/bitcoin-cli.bash-completion CURRENT="" if [ -f $BTC_VERSION_FILE ]; then CURRENT=$(cat $BTC_VERSION_FILE) @@ -359,6 +360,10 @@ if [ "$CURRENT" != "$BTC_VERSION" ]; then fi mkdir -p /home/admin/.bitcoin echo $BTC_VERSION > $BTC_VERSION_FILE + + # Install bash-completion for bitcoin-cli + wget $BTC_CLI_COMPLETION_URL -O bitcoin-cli.bash-completion + sudo cp bitcoin-cli.bash-completion /etc/bash_completion.d/bitcoin-cli fi cd ~