Last active
October 8, 2019 14:14
-
-
Save 53645714n/0581f794a81a61b0b940387a65b62927 to your computer and use it in GitHub Desktop.
Version draft
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
#!/bin/bash | |
#create variable btcversion | |
btcpi=$(bitcoin-cli -version | sed 's/.*\(.......\)/\1/') | |
btcgit=$(curl -s https://api.github.com/repos/bitcoin/bitcoin/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")') | |
if [ "$btcpi" = "$btcgit" ]; then | |
btcversion="$btcpi" | |
else | |
btcversion="$btcpi"", update available" | |
fi | |
#create variable lndversion | |
lndpi=$(lncli -version | sed 's/.*\(...........\)/\1/') | |
lndgit=$(curl -s https://api.github.com/repos/lightningnetwork/lnd/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")') | |
if [ "$lndpi" = "$lndgit" ]; then | |
lndversion="$lndpi" | |
else | |
lndversion="$lndpi"", update available" | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment