btc-balance (619B)
1 #!/usr/bin/env bash 2 #btc coins | awk '{print $3}' | xargs printf '%.8f * 100000000\n' | bc -l | xargs printf '%.0f\n' | paste -sd+ | bc -l | xargs printf '%s sats to btc\n' | bcalc -n 3 4 set -e 5 6 for wallet in personal vanessa multisig bare clightning 7 do 8 echo -n "$wallet " 9 bcli -rpcwallet="$wallet" getbalance 10 done 11 12 summary=$(lcli summary) 13 if [ -n "$summary" ] 14 then 15 echo -n "cln-availout " 16 <<<"$summary" grep avail_out | cut -d= -f2 | cut -d" " -f1 | xargs printf '%s to btc\n' | bcalc -n 17 fi 18 19 #if [ -n "$1" ]; then 20 # FIAT=$(printf '%s sats to fiat\n' "$SATS" | bcalc --price "$1") 21 # printf 'fiat\t%s\n' "$FIAT" 22 #fi