mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-09-25 11:11:02 +00:00
Re-Add: Suwayomi-Server (#6458)
This commit is contained in:
@@ -28,34 +28,20 @@ function update_script() {
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
if dpkg -l | grep -q "openjdk-17-jre"; then
|
||||
$STD apt-get remove -y openjdk-17-jre
|
||||
fi
|
||||
JAVA_VERSION=21 setup_java
|
||||
RELEASE=$(curl -fsSL https://api.github.com/repos/Suwayomi/Suwayomi-Server/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
||||
if [[ "${RELEASE}" != "$(cat /opt/suwayomi-server_version.txt)" ]] || [[ ! -f /opt/suwayomi-server_version.txt ]]; then
|
||||
msg_info "Updating $APP"
|
||||
if [[ "${RELEASE}" != "$(cat ~/.suwayomi-server 2>/dev/null)" ]] || [[ ! -f ~/.suwayomi-server ]]; then
|
||||
JAVA_VERSION=21 setup_java
|
||||
|
||||
msg_info "Stopping $APP"
|
||||
systemctl stop suwayomi-server
|
||||
msg_ok "Stopped $APP"
|
||||
|
||||
msg_info "Updating $APP to v${RELEASE}"
|
||||
temp_file=$(mktemp)
|
||||
RELEASE=$(curl -fsSL https://api.github.com/repos/Suwayomi/Suwayomi-Server/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
||||
curl -fsSL "https://github.com/Suwayomi/Suwayomi-Server/releases/download/${RELEASE}/Suwayomi-Server-${RELEASE}-debian-all.deb" -o "$temp_file"
|
||||
$STD dpkg -i "$temp_file"
|
||||
msg_ok "Updated $APP to v${RELEASE}"
|
||||
fetch_and_deploy_gh_release "suwayomi-server" "Suwayomi/Suwayomi-Server" "binary"
|
||||
|
||||
msg_info "Starting $APP"
|
||||
systemctl start suwayomi-server
|
||||
msg_ok "Started $APP"
|
||||
|
||||
msg_info "Cleaning Up"
|
||||
rm -f "$temp_file"
|
||||
msg_ok "Cleanup Completed"
|
||||
|
||||
echo "${RELEASE}" >/opt/suwayomi-server_version.txt.txt
|
||||
msg_ok "Update Successful"
|
||||
else
|
||||
msg_ok "No update required. ${APP} is already at v${RELEASE}"
|
||||
|
Reference in New Issue
Block a user