diff options
| author | Adam Soltys <[email protected]> | 2023-04-06 17:57:35 +0000 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-04-06 22:25:03 +0000 |
| commit | 4d480b400a3a7d6990aac4a0cacccd86c0fd9cd3 (patch) | |
| tree | 4ce58bcbdd3578ad53347134458a462da580c42b /watcher.sh | |
| parent | 99b72e143866d5cc62ba04847885070dc9a5c645 (diff) | |
| download | coinos-server-4d480b400a3a7d6990aac4a0cacccd86c0fd9cd3.tar.gz coinos-server-4d480b400a3a7d6990aac4a0cacccd86c0fd9cd3.zip | |
capture funds snapshotsbase
Diffstat (limited to 'watcher.sh')
| -rwxr-xr-x | watcher.sh | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -4,8 +4,10 @@ sats=100000000 threshold=$1 while true do - lnc=$(docker exec -it cl lightning-cli listfunds | jr '[.channels[] | .channel_sat] | add') - lnw=$(docker exec -it cl lightning-cli listfunds | jr '[.outputs[] | .value] | add') + f=/home/adam/coinos-server/data/funds/$(date +"%m-%d-%y-%T").json + docker exec -it cl lightning-cli listfunds > $f + lnc=$(cat $f | jr '[.channels[] | .channel_sat] | add') + lnw=$(cat $f | jr '[.outputs[] | .value] | add') ln=$(node -pe "$lnc + $lnw") bc=$(docker exec -it bc bitcoin-cli getbalance | jr) total=$(node -pe "$ln + $bc * $sats") |
