From b2e2dfed425a06eb0d11c2893cbfd72dad52d536 Mon Sep 17 00:00:00 2001 From: jash Date: Sun, 4 Nov 2018 16:52:33 +0100 Subject: [PATCH] bitcoin.conf comparison should check if file exists! >:-[ --- dist/setup.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dist/setup.sh b/dist/setup.sh index 38d85cb..4cdd41b 100755 --- a/dist/setup.sh +++ b/dist/setup.sh @@ -300,6 +300,12 @@ compare_bitcoinconf() { local new_bitcoinconf=$1 local old_bitcoinconf=$2 + local status + + if [[ ! -f $old_bitcoinconf || ! -f $new_bitcoinconf ]]; then + return 1 + fi + local old_config=$(process_bitcoinconf $old_bitcoinconf ) local new_config=$(process_bitcoinconf $new_bitcoinconf ) @@ -313,7 +319,6 @@ compare_bitcoinconf() { local new_testnet=$((($new_config>>2)&1)) local new_regtest=$((($new_config>>3)&1)) - local status if [[ $new_prune == 1 && $old_prune == 0 ]]; then # warn about data loss