Skip to content
This repository was archived by the owner on Jun 25, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1 from mayankchhabra/mayankchhabra-patch-1
Browse files Browse the repository at this point in the history
Add $RPCUSER
  • Loading branch information
mayankchhabra authored Aug 11, 2020
2 parents af3fe5e + b56d829 commit 5925dca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions switch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 5925dca

Please sign in to comment.