Skip to content

Commit e8e4748

Browse files
authored
Fix update error caused by externaly managed message (#3892)
1 parent 4b275ae commit e8e4748

File tree

1 file changed

+25
-24
lines changed

1 file changed

+25
-24
lines changed

ct/sabnzbd.sh

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,30 @@ color
2020
catch_errors
2121

2222
function update_script() {
23-
header_info
24-
check_container_storage
25-
check_container_resources
26-
if [[ ! -d /opt/sabnzbd ]]; then
27-
msg_error "No ${APP} Installation Found!"
28-
exit
29-
fi
30-
RELEASE=$(curl -fsSL https://api.github.com/repos/sabnzbd/sabnzbd/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
31-
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
32-
msg_info "Updating $APP to ${RELEASE}"
33-
systemctl stop sabnzbd.service
34-
tar zxvf <(curl -fsSL https://github.com/sabnzbd/sabnzbd/releases/download/$RELEASE/SABnzbd-${RELEASE}-src.tar.gz)
35-
cp -rf SABnzbd-${RELEASE}/* /opt/sabnzbd
36-
rm -rf SABnzbd-${RELEASE}
37-
cd /opt/sabnzbd
38-
$STD python3 -m pip install -r requirements.txt
39-
echo "${RELEASE}" >/opt/${APP}_version.txt
40-
systemctl start sabnzbd.service
41-
msg_ok "Updated ${APP} to ${RELEASE}"
42-
else
43-
msg_ok "No update required. ${APP} is already at ${RELEASE}"
44-
fi
45-
exit
23+
header_info
24+
check_container_storage
25+
check_container_resources
26+
if [[ ! -d /opt/sabnzbd ]]; then
27+
msg_error "No ${APP} Installation Found!"
28+
exit
29+
fi
30+
RELEASE=$(curl -fsSL https://api.github.com/repos/sabnzbd/sabnzbd/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
31+
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
32+
msg_info "Updating $APP to ${RELEASE}"
33+
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
34+
systemctl stop sabnzbd.service
35+
tar zxvf <(curl -fsSL https://github.com/sabnzbd/sabnzbd/releases/download/$RELEASE/SABnzbd-${RELEASE}-src.tar.gz)
36+
cp -rf SABnzbd-${RELEASE}/* /opt/sabnzbd
37+
rm -rf SABnzbd-${RELEASE}
38+
cd /opt/sabnzbd
39+
$STD python3 -m pip install -r requirements.txt
40+
echo "${RELEASE}" >/opt/${APP}_version.txt
41+
systemctl start sabnzbd.service
42+
msg_ok "Updated ${APP} to ${RELEASE}"
43+
else
44+
msg_ok "No update required. ${APP} is already at ${RELEASE}"
45+
fi
46+
exit
4647
}
4748

4849
start
@@ -52,4 +53,4 @@ description
5253
msg_ok "Completed Successfully!\n"
5354
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
5455
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
55-
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:7777${CL}"
56+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:7777${CL}"

0 commit comments

Comments
 (0)