Browse Source
change PASSWORD to RPCPASS. Make it a variable which can be set too
master
nolim1t
4 years ago
No known key found for this signature in database
GPG Key ID: F6287B82CC84BCBD
1 changed files with
7 additions and
3 deletions
-
switch.sh
|
@ -14,8 +14,12 @@ |
|
|
# Allow access to 'statuses'. /statuses/ |
|
|
# Allow access to 'statuses'. /statuses/ |
|
|
|
|
|
|
|
|
# Output: /statuses/node-status-bitcoind-ready (when ready, where a service can pick it up) |
|
|
# Output: /statuses/node-status-bitcoind-ready (when ready, where a service can pick it up) |
|
|
# Then |
|
|
|
|
|
PASSWORD=`cat /secrets/rpcpass.txt` |
|
|
|
|
|
|
|
|
# if RPCPASS doesn't exist then set it (Default to whats in /secrets/rpcpass.txt) |
|
|
|
|
|
if [ -z $RPCPASS ]; then |
|
|
|
|
|
RPCPASS=`cat /secrets/rpcpass.txt` |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
# If JSONRPCURL doesn't exist then set it |
|
|
# If JSONRPCURL doesn't exist then set it |
|
|
if [ -z $JSONRPCURL ]; then |
|
|
if [ -z $JSONRPCURL ]; then |
|
@ -32,7 +36,7 @@ while true; do |
|
|
if [ $IS_NEUTRINO -eq 1 ]; then |
|
|
if [ $IS_NEUTRINO -eq 1 ]; then |
|
|
echo "If set to neutrino then lets check bitcoind" |
|
|
echo "If set to neutrino then lets check bitcoind" |
|
|
|
|
|
|
|
|
INFO=`curl --user lncm:$PASSWORD --data-binary '{"jsonrpc": "1.0", "id":"switchme", "method": "getblockchaininfo", "params": [] }' $JSONRPCURL 2>/dev/null` |
|
|
INFO=`curl --user lncm:$RPCPASS --data-binary '{"jsonrpc": "1.0", "id":"switchme", "method": "getblockchaininfo", "params": [] }' $JSONRPCURL 2>/dev/null` |
|
|
# check for errors |
|
|
# check for errors |
|
|
ERROR=`echo $INFO | jq .error` |
|
|
ERROR=`echo $INFO | jq .error` |
|
|
if [ ! -z $ERROR ]; then |
|
|
if [ ! -z $ERROR ]; then |
|
|