From a74b7c47634b82d1b18774c11d926b1b07cb60b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Slavi=C5=A1a=20Are=C5=BEina?= <58952836+tremor021@users.noreply.github.com> Date: Fri, 22 Aug 2025 14:59:11 +0200 Subject: [PATCH] Refactor: Recyclarr (#7085) * Refactor * Update recyclarr.sh --- ct/recyclarr.sh | 31 ++++++++++++++++--------------- install/recyclarr-install.sh | 9 ++++----- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/ct/recyclarr.sh b/ct/recyclarr.sh index ec00f409b..ea6606b2b 100644 --- a/ct/recyclarr.sh +++ b/ct/recyclarr.sh @@ -20,22 +20,23 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -f /root/.config/recyclarr/recyclarr.yml ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - - msg_info "Updating ${APP}" - curl -fsSL "$(curl -fsSL https://api.github.com/repos/recyclarr/recyclarr/releases/latest | grep download | grep linux-x64 | cut -d\" -f4)" -o $(basename "$(curl -fsSL https://api.github.com/repos/recyclarr/recyclarr/releases/latest | grep download | grep linux-x64 | cut -d\" -f4)") - tar -C /usr/local/bin -xJf recyclarr*.tar.xz - rm -rf recyclarr*.tar.xz - msg_ok "Updated ${APP}" - - msg_ok "Updated Successfully" + header_info + check_container_storage + check_container_resources + if [[ ! -f /root/.config/recyclarr/recyclarr.yml ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + + RELEASE=$(curl -fsSL https://api.github.com/repos/recyclarr/recyclarr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') + if [[ "${RELEASE}" != "$(cat ~/.recyclarr 2>/dev/null)" ]] || [[ ! -f ~/.recyclarr ]]; then + fetch_and_deploy_gh_release "recyclarr" "recyclarr/recyclarr" "prebuild" "latest" "/usr/local/bin" "recyclarr-linux-x64.tar.xz" + msg_ok "Updated Successfully" + else + msg_ok "No update required. ${APP} is already at ${RELEASE}" + fi + + exit } start diff --git a/install/recyclarr-install.sh b/install/recyclarr-install.sh index e265311c6..2c271f619 100644 --- a/install/recyclarr-install.sh +++ b/install/recyclarr-install.sh @@ -17,18 +17,17 @@ msg_info "Installing Dependencies" $STD apt-get install -y git msg_ok "Installed Dependencies" -msg_info "Installing Recyclarr" -curl -fsSL "$(curl -fsSL https://api.github.com/repos/recyclarr/recyclarr/releases/latest | grep download | grep linux-x64 | cut -d\" -f4)" -o $(basename "$(curl -fsSL https://api.github.com/repos/recyclarr/recyclarr/releases/latest | grep download | grep linux-x64 | cut -d\" -f4)") -tar -C /usr/local/bin -xJf recyclarr*.tar.xz +fetch_and_deploy_gh_release "recyclarr" "recyclarr/recyclarr" "prebuild" "latest" "/usr/local/bin" "recyclarr-linux-x64.tar.xz" + +msg_info "Configuring Recyclarr" mkdir -p /root/.config/recyclarr recyclarr config create -msg_ok "Installed Recyclarr" +msg_ok "Configured Recyclarr" motd_ssh customize msg_info "Cleaning up" -rm -rf recyclarr*.tar.xz $STD apt-get -y autoremove $STD apt-get -y autoclean msg_ok "Cleaned"