Simplify whirlpool upgrade and follow new version pattern

This commit is contained in:
Taylor Helsper 2020-09-02 19:54:31 -05:00
parent b5a266fe8c
commit 6749041485
2 changed files with 16 additions and 19 deletions

View File

@ -414,13 +414,14 @@ fi
# Install Whirlpool
WHIRLPOOL_VERSION="0.10.8"
WHIRLPOOL_HASH="62e17b6020d0821a98e99ebb773b46191770ec186ceaa3e616a428f5cafe9f49"
WHIRLPOOL_UPGRADE_URL=https://code.samourai.io/whirlpool/whirlpool-client-cli/uploads/7998ea5a9bb180451616809bc346b9ac/whirlpool-client-cli-$WHIRLPOOL_VERSION-run.jar
WHIRLPOOL_SIG_URL=https://code.samourai.io/whirlpool/whirlpool-client-cli/uploads/8d919af2d97657a835195a928e7646bc/whirlpool-client-cli-$WHIRLPOOL_VERSION-run.jar.sig.asc
WHIRLPOOL_UPGRADE_URL_FILE=/home/bitcoin/.mynode/.whirlpool_url
WHIRLPOOL_UPLOAD_FILE_ID="7998ea5a9bb180451616809bc346b9ac"
WHIRLPOOL_UPLOAD_SIG_ID="8d919af2d97657a835195a928e7646bc"
WHIRLPOOL_UPGRADE_URL=https://code.samourai.io/whirlpool/whirlpool-client-cli/uploads/$WHIRLPOOL_UPLOAD_FILE_ID/whirlpool-client-cli-$WHIRLPOOL_VERSION-run.jar
WHIRLPOOL_SIG_URL=https://code.samourai.io/whirlpool/whirlpool-client-cli/uploads/$WHIRLPOOL_UPLOAD_SIG_ID/whirlpool-client-cli-$WHIRLPOOL_VERSION-run.jar.sig.asc
WHIRLPOOL_VERSION_FILE=/home/bitcoin/.mynode/whirlpool_version
CURRENT=""
if [ -f $WHIRLPOOL_UPGRADE_URL_FILE ]; then
CURRENT=$(cat $WHIRLPOOL_UPGRADE_URL_FILE)
if [ -f $WHIRLPOOL_VERSION_FILE ]; then
CURRENT=$(cat $WHIRLPOOL_VERSION_FILE)
fi
if [ "$CURRENT" != "$WHIRLPOOL_UPGRADE_URL" ]; then
sudo -u bitcoin mkdir -p /opt/mynode/whirlpool
@ -428,13 +429,10 @@ if [ "$CURRENT" != "$WHIRLPOOL_UPGRADE_URL" ]; then
sudo rm -rf *.jar
sudo -u bitcoin wget -O whirlpool.jar $WHIRLPOOL_UPGRADE_URL
echo "$WHIRLPOOL_HASH whirlpool.jar" > /tmp/whirlpool.shasum
sha256sum --check /tmp/whirlpool.shasum
rm /tmp/whirlpool.shasum
wget -O whirlpool.asc $WHIRLPOOL_SIG_URL
gpg --verify whirlpool.asc
echo $WHIRLPOOL_UPGRADE_URL > $WHIRLPOOL_UPGRADE_URL_FILE
echo $WHIRLPOOL_VERSION > $WHIRLPOOL_VERSION_FILE
fi

View File

@ -507,13 +507,14 @@ fi
# Install Whirlpool
WHIRLPOOL_VERSION="0.10.8"
WHIRLPOOL_HASH="62e17b6020d0821a98e99ebb773b46191770ec186ceaa3e616a428f5cafe9f49"
WHIRLPOOL_UPGRADE_URL=https://code.samourai.io/whirlpool/whirlpool-client-cli/uploads/7998ea5a9bb180451616809bc346b9ac/whirlpool-client-cli-$WHIRLPOOL_VERSION-run.jar
WHIRLPOOL_SIG_URL=https://code.samourai.io/whirlpool/whirlpool-client-cli/uploads/8d919af2d97657a835195a928e7646bc/whirlpool-client-cli-$WHIRLPOOL_VERSION-run.jar.sig.asc
WHIRLPOOL_UPGRADE_URL_FILE=/home/bitcoin/.mynode/.whirlpool_url
WHIRLPOOL_UPLOAD_FILE_ID="7998ea5a9bb180451616809bc346b9ac"
WHIRLPOOL_UPLOAD_SIG_ID="8d919af2d97657a835195a928e7646bc"
WHIRLPOOL_UPGRADE_URL=https://code.samourai.io/whirlpool/whirlpool-client-cli/uploads/$WHIRLPOOL_UPLOAD_FILE_ID/whirlpool-client-cli-$WHIRLPOOL_VERSION-run.jar
WHIRLPOOL_SIG_URL=https://code.samourai.io/whirlpool/whirlpool-client-cli/uploads/$WHIRLPOOL_UPLOAD_SIG_ID/whirlpool-client-cli-$WHIRLPOOL_VERSION-run.jar.sig.asc
WHIRLPOOL_VERSION_FILE=/home/bitcoin/.mynode/whirlpool_version
CURRENT=""
if [ -f $WHIRLPOOL_UPGRADE_URL_FILE ]; then
CURRENT=$(cat $WHIRLPOOL_UPGRADE_URL_FILE)
if [ -f $WHIRLPOOL_VERSION_FILE ]; then
CURRENT=$(cat $WHIRLPOOL_VERSION_FILE)
fi
if [ "$CURRENT" != "$WHIRLPOOL_UPGRADE_URL" ]; then
sudo -u bitcoin mkdir -p /opt/mynode/whirlpool
@ -521,12 +522,10 @@ if [ "$CURRENT" != "$WHIRLPOOL_UPGRADE_URL" ]; then
sudo rm -rf *.jar
sudo -u bitcoin wget -O whirlpool.jar $WHIRLPOOL_UPGRADE_URL
echo "$WHIRLPOOL_HASH whirlpool.jar" > WHIRLPOOL_SHASUM
sha256sum --check WHIRLPOOL_SHASUM
wget -O whirlpool.asc $WHIRLPOOL_SIG_URL
gpg --verify whirlpool.asc
echo $WHIRLPOOL_UPGRADE_URL > $WHIRLPOOL_UPGRADE_URL_FILE
echo $WHIRLPOOL_VERSION > $WHIRLPOOL_VERSION_FILE
fi