From e8e4748c966c5a8a3c38b0a2f3077a113cf2cb83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Slavi=C5=A1a=20Are=C5=BEina?= <58952836+tremor021@users.noreply.github.com> Date: Tue, 15 Apr 2025 11:22:43 +0200 Subject: [PATCH] Fix update error caused by externaly managed message (#3892) --- ct/sabnzbd.sh | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/ct/sabnzbd.sh b/ct/sabnzbd.sh index fe84431db..b67a18407 100644 --- a/ct/sabnzbd.sh +++ b/ct/sabnzbd.sh @@ -20,29 +20,30 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d /opt/sabnzbd ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - RELEASE=$(curl -fsSL https://api.github.com/repos/sabnzbd/sabnzbd/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then - msg_info "Updating $APP to ${RELEASE}" - systemctl stop sabnzbd.service - tar zxvf <(curl -fsSL https://github.com/sabnzbd/sabnzbd/releases/download/$RELEASE/SABnzbd-${RELEASE}-src.tar.gz) - cp -rf SABnzbd-${RELEASE}/* /opt/sabnzbd - rm -rf SABnzbd-${RELEASE} - cd /opt/sabnzbd - $STD python3 -m pip install -r requirements.txt - echo "${RELEASE}" >/opt/${APP}_version.txt - systemctl start sabnzbd.service - msg_ok "Updated ${APP} to ${RELEASE}" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" - fi - exit + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/sabnzbd ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + RELEASE=$(curl -fsSL https://api.github.com/repos/sabnzbd/sabnzbd/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') + if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then + msg_info "Updating $APP to ${RELEASE}" + rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED + systemctl stop sabnzbd.service + tar zxvf <(curl -fsSL https://github.com/sabnzbd/sabnzbd/releases/download/$RELEASE/SABnzbd-${RELEASE}-src.tar.gz) + cp -rf SABnzbd-${RELEASE}/* /opt/sabnzbd + rm -rf SABnzbd-${RELEASE} + cd /opt/sabnzbd + $STD python3 -m pip install -r requirements.txt + echo "${RELEASE}" >/opt/${APP}_version.txt + systemctl start sabnzbd.service + msg_ok "Updated ${APP} to ${RELEASE}" + else + msg_ok "No update required. ${APP} is already at ${RELEASE}" + fi + exit } start @@ -52,4 +53,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:7777${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:7777${CL}"