@@ -24,40 +24,38 @@ function update_script() {
2424 check_container_storage
2525 check_container_resources
2626
27+ if par2 --version | grep -q " par2cmdline-turbo" ; then
28+ fetch_and_deploy_gh_release " par2cmdline-turbo" " animetosho/par2cmdline-turbo" " prebuild" " latest" " /usr/bin/" " *-linux-amd64.zip"
29+ fi
30+
2731 if [[ ! -d /opt/sabnzbd ]]; then
2832 msg_error " No ${APP} Installation Found!"
2933 exit
3034 fi
31- setup_uv
32- RELEASE=$( curl -fsSL https://api.github.com/repos/sabnzbd/sabnzbd/releases/latest | grep " tag_name" | awk ' {print substr($2, 2, length($2)-3) }' )
33- if [[ -f /opt/${APP} _version.txt ]] && [[ " ${RELEASE} " == " $( cat /opt/${APP} _version.txt) " ]]; then
34- msg_ok " No update required. ${APP} is already at ${RELEASE} "
35- exit
36- fi
37- setup_uv
38- msg_info " Updating $APP to ${RELEASE} "
39- systemctl stop sabnzbd
40- cp -r /opt/sabnzbd /opt/sabnzbd_backup_$( date +%s)
41- temp_file=$( mktemp)
42- curl -fsSL " https://github.com/sabnzbd/sabnzbd/releases/download/${RELEASE} /SABnzbd-${RELEASE} -src.tar.gz" -o " $temp_file "
43- tar -xzf " $temp_file " -C /opt/sabnzbd --strip-components=1
44- rm -f " $temp_file "
45- if [[ ! -d /opt/sabnzbd/venv ]]; then
46- msg_info " Migrating SABnzbd to uv virtual environment"
47- $STD uv venv /opt/sabnzbd/venv
48- msg_ok " Created uv venv at /opt/sabnzbd/venv"
35+ if check_for_gh_release " sabnzbd-org" " sabnzbd/sabnzbd" ; then
36+ PYTHON_VERSION=" 3.13" setup_uv
37+ systemctl stop sabnzbd
38+ cp -r /opt/sabnzbd /opt/sabnzbd_backup_$( date +%s)
39+ fetch_and_deploy_gh_release " sabnzbd-org" " sabnzbd/sabnzbd" " prebuild" " latest" " /opt/sabnzbd" " SABnzbd-*-src.tar.gz"
4940
50- if grep -q " ExecStart=python3 SABnzbd.py" /etc/systemd/system/sabnzbd.service; then
51- sed -i " s|ExecStart=python3 SABnzbd.py|ExecStart=/opt/sabnzbd/venv/bin/python SABnzbd.py|" /etc/systemd/system/sabnzbd.service
52- systemctl daemon-reload
53- msg_ok " Updated SABnzbd service to use uv venv"
41+
42+ if [[ ! -d /opt/sabnzbd/venv ]]; then
43+ msg_info " Migrating SABnzbd to uv virtual environment"
44+ $STD uv venv /opt/sabnzbd/venv
45+ msg_ok " Created uv venv at /opt/sabnzbd/venv"
46+
47+ if grep -q " ExecStart=python3 SABnzbd.py" /etc/systemd/system/sabnzbd.service; then
48+ sed -i " s|ExecStart=python3 SABnzbd.py|ExecStart=/opt/sabnzbd/venv/bin/python SABnzbd.py|" /etc/systemd/system/sabnzbd.service
49+ systemctl daemon-reload
50+ msg_ok " Updated SABnzbd service to use uv venv"
51+ fi
5452 fi
53+ $STD uv pip install --upgrade pip --python=/opt/sabnzbd/venv/bin/python
54+ $STD uv pip install -r /opt/sabnzbd/requirements.txt --python=/opt/sabnzbd/venv/bin/python
55+
56+ systemctl start sabnzbd
57+ msg_ok " Updated Successfully"
5558 fi
56- $STD uv pip install --upgrade pip --python=/opt/sabnzbd/venv/bin/python
57- $STD uv pip install -r /opt/sabnzbd/requirements.txt --python=/opt/sabnzbd/venv/bin/python
58- echo " ${RELEASE} " > /opt/${APP} _version.txt
59- systemctl start sabnzbd
60- msg_ok " Updated ${APP} to ${RELEASE} "
6159 exit
6260}
6361
0 commit comments