From b56d8298fb360040427a24bfdd357793d52f905d Mon Sep 17 00:00:00 2001 From: Mayank Chhabra Date: Tue, 11 Aug 2020 15:27:33 +0530 Subject: [PATCH] Add RPCUSER --- switch.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/switch.sh b/switch.sh index 50a88cc..d97c3e9 100755 --- a/switch.sh +++ b/switch.sh @@ -14,7 +14,7 @@ # Allow access to 'statuses'. /statuses/ # Output: /statuses/node-status-bitcoind-ready (when ready, where a service can pick it up) - +RPCUSER="${RPCUSER:-umbrelrpc}" RPCPASS="${RPCPASS:-$(cat /secrets/rpcpass.txt)}" # Default password location: /secrets/rpcpass.txt SLEEPTIME="${SLEEPTIME:-3600}" # Default sleep: 3600 JSONRPCURL="${JSONRPCURL:-http://10.254.2.2:8332}" # Default RPC endpoint: http://10.254.2.2:8332 @@ -38,7 +38,7 @@ switch_on_sync_done() { echo 'If set to neutrino then lets check bitcoind' - if ! INFO="$(curl --silent --user "lncm:$RPCPASS" --data-binary '{"jsonrpc": "1.0", "id":"switchme", "method": "getblockchaininfo", "params": [] }' "$JSONRPCURL")"; then + if ! INFO="$(curl --silent --user "$RPCUSER:$RPCPASS" --data-binary '{"jsonrpc": "1.0", "id":"switchme", "method": "getblockchaininfo", "params": [] }' "$JSONRPCURL")"; then echo "Error: 'getblockchaininfo' request to bitcoind failed" return fi