This commit is contained in:
Slaviša Arežina 2025-07-30 15:19:58 +02:00 committed by GitHub
parent 234b4e334e
commit f33c292c3e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 20 deletions

View file

@ -27,23 +27,21 @@ function update_script() {
msg_error "No ${APP} Installation Found!"
exit
fi
msg_info "Updating ${APP}"
RELEASE=$(curl -fsSL https://api.github.com/repos/gotson/komga/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
if [[ ! -f ~/.komga ]] || [[ "${RELEASE}" != "$(cat ~/.komga)" ]]; then
msg_info "Stopping ${APP}"
systemctl stop komga
msg_ok "Stopped ${APP}"
msg_info "Updating ${APP} to ${RELEASE}"
curl -fsSL "https://github.com/gotson/komga/releases/download/${RELEASE}/komga-${RELEASE}.jar" -o $(basename "https://github.com/gotson/komga/releases/download/${RELEASE}/komga-${RELEASE}.jar")
rm -rf /opt/komga/komga.jar
mv -f komga-${RELEASE}.jar /opt/komga/komga.jar
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated ${APP} to ${RELEASE}"
rm -f /opt/komga/komga.jar
USE_ORIGINAL_FILENAME="true" fetch_and_deploy_gh_release "komga" "gotson/komga" "singlefile" "latest" "/opt/komga" "komga*.jar"
mv /opt/komga/komga-*.jar /opt/komga/komga.jar
msg_info "Starting ${APP}"
systemctl start komga
msg_ok "Started ${APP}"
msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}."