From 663516699cc5abbacd98a9d62de037d892da19f6 Mon Sep 17 00:00:00 2001 From: LaMat <65860122+lamat1111@users.noreply.github.com> Date: Mon, 27 May 2024 11:27:46 +0200 Subject: [PATCH] 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 --- update.sh | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/update.sh b/update.sh index 633caec..96b7152 100644 --- a/update.sh +++ b/update.sh @@ -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 \ No newline at end of file +sudo journalctl -u ceremonyclient.service -f --no-hostname -o cat