Browse Source

Merge pull request #1 from mayankchhabra/mayankchhabra-patch-1

Add $RPCUSER
master v1.0.3
Mayank Chhabra 4 years ago
committed by GitHub
parent
commit
5925dca464
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      switch.sh

4
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

Loading…
Cancel
Save