Created
October 23, 2017 16:38
-
-
Save jb55/1f9f0cd8906c82d577d96f97d9584230 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
howlong() { | |
mins=$(($1 * 10)) | |
target=$(date -u -d "now + $mins minutes" -Iseconds) | |
targetp=$(date -d $target '+%F %R %Z') | |
ddiff=$(datediff -f "%dd %Hh %0Mm @ $targetp" "now" "$target") | |
printf "%s\n" "$ddiff" | |
} | |
height=$(bitcoin-cli getblockcount) | |
segwit2x=$((494784 - height)) | |
gold=$((491407 - height)) | |
printf "s2x(%sb, %s)\ngold(%sb, %s)\n" \ | |
"$segwit2x" "$(howlong $segwit2x)" \ | |
"$gold" "$(howlong $gold)" |
Author
jb55
commented
Oct 23, 2017
•
dateutils required for datediff
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment