From 7b7817bc4d4a2f000d619be80799ec019cface1b Mon Sep 17 00:00:00 2001 From: Taylor Helsper Date: Wed, 9 Feb 2022 22:31:42 -0600 Subject: [PATCH] Don't reset Bitcoin RPC password if resetting blockchain data --- rootfs/standard/usr/bin/mynode_startup.sh | 6 ++++++ rootfs/standard/var/www/mynode/device_info.py | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/rootfs/standard/usr/bin/mynode_startup.sh b/rootfs/standard/usr/bin/mynode_startup.sh index 65ddb9ae..8e477818 100755 --- a/rootfs/standard/usr/bin/mynode_startup.sh +++ b/rootfs/standard/usr/bin/mynode_startup.sh @@ -536,6 +536,12 @@ chown bitcoin:bitcoin /mnt/hdd/mynode/settings/.btcrpc_environment if [ -f /mnt/hdd/mynode/bitcoin/bitcoin.conf ]; then sed -i "s/rpcauth=.*/$RPCAUTH/g" /mnt/hdd/mynode/bitcoin/bitcoin.conf fi +if [ -f /mnt/hdd/mynode/dojo/docker/my-dojo/conf/docker-bitcoind.conf ]; then + sed -i "s/BITCOIND_RPC_PASSWORD=.*/BITCOIND_RPC_PASSWORD=$BTCRPCPW/g" /mnt/hdd/mynode/dojo/docker/my-dojo/conf/docker-bitcoind.conf +fi +if [ -f /mnt/hdd/mynode/dojo/docker/my-dojo/conf/docker-bitcoind.conf.tpl ]; then + sed -i "s/BITCOIND_RPC_PASSWORD=.*/BITCOIND_RPC_PASSWORD=$BTCRPCPW/g" /mnt/hdd/mynode/dojo/docker/my-dojo/conf/docker-bitcoind.conf.tpl +fi # Append bitcoin UID and GID to btcrpc_environment diff --git a/rootfs/standard/var/www/mynode/device_info.py b/rootfs/standard/var/www/mynode/device_info.py index 3cacab20..80cf7fe3 100644 --- a/rootfs/standard/var/www/mynode/device_info.py +++ b/rootfs/standard/var/www/mynode/device_info.py @@ -891,8 +891,8 @@ def reset_bitcoin_env_file(): def delete_bitcoin_data(): os.system("rm -rf /mnt/hdd/mynode/bitcoin") os.system("rm -rf /mnt/hdd/mynode/quicksync/.quicksync_complete") - os.system("rm -rf /mnt/hdd/mynode/settings/.btcrpc_environment") - os.system("rm -rf /mnt/hdd/mynode/settings/.btcrpcpw") + #os.system("rm -rf /mnt/hdd/mynode/settings/.btcrpc_environment") + #os.system("rm -rf /mnt/hdd/mynode/settings/.btcrpcpw") def reset_blockchain(): stop_bitcoin() @@ -1206,5 +1206,5 @@ def generate_qr_code(url): img = qr.make_image() return img except Exception as e: - print("generate_qr_code exception: {}".format(str(e))) + log_message("generate_qr_code exception: {}".format(str(e))) return None \ No newline at end of file