1
0
mirror of https://github.com/community-scripts/ProxmoxVE.git synced 2025-04-20 19:08:06 +00:00

Fix update error caused by externaly managed message (#3892)

This commit is contained in:
Slaviša Arežina 2025-04-15 11:22:43 +02:00 committed by GitHub
parent 4b275ae911
commit e8e4748c96
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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}"
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:7777${CL}"