11#! /usr/bin/env bash
22source <( curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
33# Copyright (c) 2021-2025 community-scripts ORG
4- # Author: tremor021
4+ # Author: Slaviša Arežina ( tremor021)
55# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
66# Source: https://github.com/Suwayomi/Suwayomi-Server
77
@@ -20,38 +20,46 @@ color
2020catch_errors
2121
2222function update_script() {
23- header_info
24- check_container_storage
25- check_container_resources
23+ header_info
24+ check_container_storage
25+ check_container_resources
2626
27- if [[ ! -f /usr/bin/suwayomi-server ]]; then
28- msg_error " No ${APP} Installation Found!"
29- exit
30- fi
31- RELEASE=$( curl -fsSL https://api.github.com/repos/Suwayomi/Suwayomi-Server/releases/latest | grep " tag_name" | awk ' {print substr($2, 2, length($2)-3) }' )
32- if [[ " ${RELEASE} " != " $( cat /opt/suwayomi-server_version.txt) " ]] || [[ ! -f /opt/suwayomi-server_version.txt ]]; then
33- msg_info " Updating $APP "
34- msg_info " Stopping $APP "
35- systemctl stop suwayomi-server
36- msg_ok " Stopped $APP "
37- msg_info " Updating $APP to v${RELEASE} "
38- cd /tmp
39- URL=$( curl -fsSL https://api.github.com/repos/Suwayomi/Suwayomi-Server/releases/latest | grep " browser_download_url" | awk ' {print substr($2, 2, length($2)-2) }' | tail -n+2 | head -n 1)
40- curl -fsSL " $URL " -o $( basename " $URL " )
41- $STD dpkg -i /tmp/* .deb
42- msg_ok " Updated $APP to v${RELEASE} "
43- msg_info " Starting $APP "
44- systemctl start suwayomi-server
45- msg_ok " Started $APP "
46- msg_info " Cleaning Up"
47- rm -f * .deb
48- msg_ok " Cleanup Completed"
49- echo " ${RELEASE} " > /opt/suwayomi-server_version.txt.txt
50- msg_ok " Update Successful"
51- else
52- msg_ok " No update required. ${APP} is already at v${RELEASE} "
53- fi
27+ if [[ ! -f /usr/bin/suwayomi-server ]]; then
28+ msg_error " No ${APP} Installation Found!"
5429 exit
30+ fi
31+ if dpkg -l | grep -q " openjdk-17-jre" ; then
32+ $STD apt-get remove -y openjdk-17-jre
33+ mkdir -p /etc/apt/keyrings
34+ curl -fsSL " https://packages.adoptium.net/artifactory/api/gpg/key/public" | gpg --dearmor > /etc/apt/trusted.gpg.d/adoptium.gpg
35+ echo " deb https://packages.adoptium.net/artifactory/deb $( awk -F= ' /^VERSION_CODENAME/{print$2}' /etc/os-release) main" > /etc/apt/sources.list.d/adoptium.list
36+ $STD apt-get update
37+ $STD apt-get install -y temurin-21-jre
38+ fi
39+ RELEASE=$( curl -fsSL https://api.github.com/repos/Suwayomi/Suwayomi-Server/releases/latest | grep " tag_name" | awk ' {print substr($2, 2, length($2)-3) }' )
40+ if [[ " ${RELEASE} " != " $( cat /opt/suwayomi-server_version.txt) " ]] || [[ ! -f /opt/suwayomi-server_version.txt ]]; then
41+ msg_info " Updating $APP "
42+ msg_info " Stopping $APP "
43+ systemctl stop suwayomi-server
44+ msg_ok " Stopped $APP "
45+ msg_info " Updating $APP to v${RELEASE} "
46+ cd /tmp
47+ URL=$( curl -fsSL https://api.github.com/repos/Suwayomi/Suwayomi-Server/releases/latest | grep " browser_download_url" | awk ' {print substr($2, 2, length($2)-2) }' | tail -n+2 | head -n 1)
48+ curl -fsSL " $URL " -o $( basename " $URL " )
49+ $STD dpkg -i /tmp/* .deb
50+ msg_ok " Updated $APP to v${RELEASE} "
51+ msg_info " Starting $APP "
52+ systemctl start suwayomi-server
53+ msg_ok " Started $APP "
54+ msg_info " Cleaning Up"
55+ rm -f * .deb
56+ msg_ok " Cleanup Completed"
57+ echo " ${RELEASE} " > /opt/suwayomi-server_version.txt.txt
58+ msg_ok " Update Successful"
59+ else
60+ msg_ok " No update required. ${APP} is already at v${RELEASE} "
61+ fi
62+ exit
5563}
5664
5765start
0 commit comments