From effb4a30d406e591698871358680b6d543c03fc2 Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Mon, 14 Oct 2024 13:24:32 +0300 Subject: [PATCH] bugfix --- update/update.sh | 39 ++++++++++++--------------------------- 1 file changed, 12 insertions(+), 27 deletions(-) diff --git a/update/update.sh b/update/update.sh index 1ea7a45..e240c45 100644 --- a/update/update.sh +++ b/update/update.sh @@ -40,26 +40,12 @@ git checkout main git branch -D release git pull git checkout release -echo "✅ Downloaded the latest changes successfully." +echo "✅ Github repo updated to the latest changes successfully." echo -get_os_arch() { - local os=$(uname -s | tr '[:upper:]' '[:lower:]') - local arch=$(uname -m) - - case "$os" in - linux|darwin) ;; - *) echo "Unsupported operating system: $os" >&2; return 1 ;; - esac - - case "$arch" in - x86_64|amd64) arch="amd64" ;; - arm64|aarch64) arch="arm64" ;; - *) echo "Unsupported architecture: $arch" >&2; return 1 ;; - esac - - echo "${os}-${arch}" -} +#========================== +# NODE BINARY DOWNLOAD +#========================== get_os_arch() { local os=$(uname -s | tr '[:upper:]' '[:lower:]') @@ -79,16 +65,15 @@ get_os_arch() { echo "${os}-${arch}" } -# Base URL for the Quilibrium releases -RELEASE_FILES_URL="https://releases.quilibrium.com/release" - -cd ~/ceremonyclient/node - # Get the current OS and architecture OS_ARCH=$(get_os_arch) +# Base URL for the Quilibrium releases +RELEASE_FILES_URL="https://releases.quilibrium.com/release" + # Fetch the list of files from the release page -RELEASE_FILES=$(curl -s $RELEASE_FILES_URL | grep -oE "node-[0-9]+\.[0-9]+\.[0-9]+-${OS_ARCH}(\.dgst)?(\.sig\.[0-9]+)?") +# Updated regex to allow for an optional fourth version number +RELEASE_FILES=$(curl -s $RELEASE_FILES_URL | grep -oE "node-[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?-${OS_ARCH}(\.dgst)?(\.sig\.[0-9]+)?") # Change to the download directory cd ~/ceremonyclient/node @@ -96,13 +81,13 @@ cd ~/ceremonyclient/node # Download each file for file in $RELEASE_FILES; do echo "Downloading $file..." - wget "https://releases.quilibrium.com/$file" + curl -L -o "$file" "https://releases.quilibrium.com/$file" # Check if the download was successful if [ $? -eq 0 ]; then echo "Successfully downloaded $file" # Check if the file is the base binary (without .dgst or .sig suffix) - if [[ $file =~ ^node-[0-9]+\.[0-9]+\.[0-9]+-${OS_ARCH}$ ]]; then + if [[ $file =~ ^node-[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?-${OS_ARCH}$ ]]; then echo "Making $file executable..." chmod +x "$file" if [ $? -eq 0 ]; then @@ -118,7 +103,7 @@ for file in $RELEASE_FILES; do echo "------------------------" done -echo "Download process completed." +echo "✅ Node binary download completed."