From 692adfd13ac99a645dc4459c50c9b281eb9f5523 Mon Sep 17 00:00:00 2001 From: bilulib Date: Thu, 8 May 2025 23:50:23 +0200 Subject: [PATCH] fix git url errors --- install/huntarr-install.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/install/huntarr-install.sh b/install/huntarr-install.sh index 5e3c313..af37441 100644 --- a/install/huntarr-install.sh +++ b/install/huntarr-install.sh @@ -14,6 +14,9 @@ setting_up_container network_check update_os +APPLICATION="huntarr" +SPINNER_PID=0 + # Installing Dependencies msg_info "Installing Dependencies" $STD apt-get install -y \ @@ -24,10 +27,13 @@ msg_ok "Installed Dependencies" # Setup App msg_info "Setup ${APPLICATION}" -RELEASE=$(curl -fsSL https://api.github.com/repos/plexguide/Huntarr.io/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}') +LATEST_JSON=$(curl -fsSL https://api.github.com/repos/plexguide/Huntarr.io/releases/latest) +RELEASE=$(echo "$LATEST_JSON" | grep '"tag_name":' | head -1 | cut -d '"' -f4) +DOWNLOAD_URL=$(echo "$LATEST_JSON" | grep 'browser_download_url' | grep linux_amd64.tar.gz | cut -d '"' -f4) +TAR_FILE=$(basename "$DOWNLOAD_URL") mkdir -p /opt/${APPLICATION} -curl -fsSL -o "/opt/${APPLICATION}/${APPLICATION}_${RELEASE}_linux_amd64.tar.gz" "https://github.com/plexguide/Huntarr.io/releases/download/${RELEASE}/${APPLICATION}_${RELEASE}_linux_amd64.tar.gz" -tar -xzf "/opt/${APPLICATION}/${APPLICATION}_${RELEASE}_linux_amd64.tar.gz" -C /opt/${APPLICATION} +curl -fsSL -o "/opt/${APPLICATION}/${TAR_FILE}" "$DOWNLOAD_URL" +tar -xzf "/opt/${APPLICATION}/${TAR_FILE}" -C /opt/${APPLICATION} chmod +x /opt/${APPLICATION}/${APPLICATION} echo "${RELEASE}" >/opt/${APPLICATION}_version.txt msg_ok "Setup ${APPLICATION}" @@ -55,7 +61,7 @@ customize # Cleanup msg_info "Cleaning up" -rm -f ${RELEASE}.zip +rm -f "/opt/${APPLICATION}/${TAR_FILE}" $STD apt-get -y autoremove $STD apt-get -y autoclean msg_ok "Cleaned"