diff --git a/README.md b/README.md index cae4241..b21ef03 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,16 @@ poollogs.json to docs/poollogs.json and send the update to your git repo. To display the pool frontend, enable docs-site on github repository settings. +## Batch mode + +The script is also runnable by cron using the -y argument: + +`python liskpool.py -y` + +There is also a 'batch.sh' file which run liskpool, then payments.sh and copy the poollogs.json +in the docs folder. + + ## License Copyright 2017 Davide Gessa diff --git a/batch.sh b/batch.sh new file mode 100644 index 0000000..13c7655 --- /dev/null +++ b/batch.sh @@ -0,0 +1,3 @@ +python3 liskpool.py -y +bash payments.sh +cp poollogs.json docs/poollogs.json diff --git a/liskpool.py b/liskpool.py index f35d691..bf75f10 100644 --- a/liskpool.py +++ b/liskpool.py @@ -1,5 +1,6 @@ import requests import json +import sys import time NODE = "https://wallet.lisknode.io" @@ -105,6 +106,10 @@ def estimatePayouts (log): print (json.dumps (log, indent=4, separators=(',', ': '))) - yes = input ('save? y/n: ') - if yes == 'y': + if len (sys.argv) > 1 and sys.argv[1] == '-y': + print ('Saving...') saveLog (log) + else: + yes = input ('save? y/n: ') + if yes == 'y': + saveLog (log)