aboutsummaryrefslogtreecommitdiffstats
path: root/watcher.sh
diff options
context:
space:
mode:
Diffstat (limited to 'watcher.sh')
-rwxr-xr-xwatcher.sh15
1 files changed, 8 insertions, 7 deletions
diff --git a/watcher.sh b/watcher.sh
index 6de246fb..b12ee1cb 100755
--- a/watcher.sh
+++ b/watcher.sh
@@ -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