@@ -20,29 +20,30 @@ color
2020catch_errors
2121
2222function 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
4849start
@@ -52,4 +53,4 @@ description
5253msg_ok " Completed Successfully!\n"
5354echo -e " ${CREATING}${GN}${APP} setup has been successfully initialized!${CL} "
5455echo -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