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