diff --git a/README.md b/README.md index 514c10b..5f54d02 100644 --- a/README.md +++ b/README.md @@ -28,4 +28,4 @@ Other than that everything should be in the default paths. - RPCPASS (default: whatever is set in /secrets/rpcpass.txt .) - If we set this, we do not need to link rpcpass.txt (this is generated by configure-box.sh by [the box configure script](https://github.com/lncm/thebox-compose-system/blob/master/configure-box.sh)) - JSONRPCURL (Default: http://10.254.2.2:8332) : Is the JSON-RPC interface for bitcoind - LND_CONTAINER_NAME (Default: lnd) : is the container name to restart - +- SLEEPTIME (Default: 3600) : Configures how often to poll. Ideally we should set this high so we minimize disruptions, but we might want to set it lower for testing. diff --git a/switch.sh b/switch.sh index 6504840..465072b 100755 --- a/switch.sh +++ b/switch.sh @@ -21,6 +21,11 @@ if [ -z $RPCPASS ]; then RPCPASS=`cat /secrets/rpcpass.txt` fi +# If sleeptime isn't set, set it to 3600 (1 hour) +if [ -z $SLEEPTIME ]; then + SLEEPTIME=3600 +fi + # If JSONRPCURL doesn't exist then set it if [ -z $JSONRPCURL ]; then JSONRPCURL="http://10.254.2.2:8332" @@ -87,6 +92,6 @@ while true; do #TODO: Lets maybe try to switch back fi - # Run every every 1 hour - sleep 3600 + # Run every every 1 hour by default or as per configurable + sleep $SLEEPTIME done