Update update.sh

- added check to see if there is an update available in the repo
- moved version variable at the beginning and added it to the step 1 echo message
This commit is contained in:
LaMat 2024-05-27 11:27:46 +02:00 committed by GitHub
parent 70e8404239
commit 663516699c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,17 +7,31 @@ echo "The script is prepared for Ubuntu machines. If you are using another opera
echo "⏳Processing..."
sleep 10 # Add a 10-second delay
# Set the version number
VERSION="1.4.18"
# Step 0.1: Check for updates
echo "⏳ Checking for updates..."
cd ~/ceremonyclient
git fetch
LOCAL=$(git rev-parse @)
REMOTE=$(git rev-parse @{u})
if [ "$LOCAL" = "$REMOTE" ]; then
echo "Your Quilibrium Node is already up to date. No updates to pull."
exit 0
else
echo "New update found. Proceeding with the upgrade..."
fi
# Stop the ceremonyclient service
service ceremonyclient stop
# Step 1:Download Binary
echo "⏳ Downloading New Release v1.4.18"
cd ~/ceremonyclient
git pull
echo "⏳ Downloading New Release $VERSION"
git checkout release
# Set the version number
VERSION="1.4.18"
# Get the system architecture
ARCH=$(uname -m)
@ -70,4 +84,4 @@ sudo service ceremonyclient start
echo "🎉 Welcome to Quilibrium Ceremonyclient v1.4.18"
echo "⏳ Please let it flow node logs at least 5 minutes then you can press CTRL + C to exit the logs."
sleep 5 # Add a 5-second delay
sudo journalctl -u ceremonyclient.service -f --no-hostname -o cat
sudo journalctl -u ceremonyclient.service -f --no-hostname -o cat