diff options
| author | Adam Soltys <[email protected]> | 2023-03-22 15:53:35 +0000 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-03-22 15:53:49 +0000 |
| commit | b8e7de704694bbcbdd58338704832e50c216dcdc (patch) | |
| tree | ab715a468832d6bbdbbab9a659dd23a9b10d9f97 /watcher.sh | |
| parent | 469c384e0930dd2b7c0f01c03cca95f86f05277d (diff) | |
| download | coinos-server-b8e7de704694bbcbdd58338704832e50c216dcdc.tar.gz coinos-server-b8e7de704694bbcbdd58338704832e50c216dcdc.zip | |
catch update errors
Diffstat (limited to 'watcher.sh')
| -rwxr-xr-x | watcher.sh | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -12,11 +12,12 @@ do accts=$(curl -s https://coinos.io/api/balances | jr '.total') gap=$(node -pe "$accts - $total") echo $(date -Is) lnc $lnc lnw $lnw bc $bc tot $total gap $gap - # low=$(node -pe "!!($gap > $threshold)") - # if "$low"; then - # echo "Threshold hit, setting new threshold" - # pnpm pm2 stop 0 > /dev/null - # node /root/mailgun/index.js - # fi - sleep 60 + low=$(node -pe "!!($gap > $threshold)") + + if "$low"; then + echo "Threshold hit, setting new threshold" + docker stop app; + curl localhost:3119/email -H "content-type: application/json" -d '{"token": "MPJzfq97ab!!!!", "message": "threshold hit"}' + fi + sleep 120 done |
