Add update function to Kapowarr

This commit is contained in:
tremor021 2025-06-09 10:13:17 +02:00
parent 6826cf2d36
commit 9bf42a082c

View File

@ -23,11 +23,33 @@ function update_script() {
header_info header_info
check_container_storage check_container_storage
check_container_resources check_container_resources
if [[ ! -f /etc/systemd/system/kapowarr.service ]]; then if [[ ! -f /etc/systemd/system/kapowarr.service ]]; then
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit exit
fi fi
msg_error "No Update." RELEASE=$(curl -s https://api.github.com/repos/Casvt/Kapowarr/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
if [[ "${RELEASE}" != "$(cat $HOME/.kapowarr)" ]] || [[ ! -f $HOME/.kapowarr ]]; then
msg_info "Stopping $APP"
systemctl stop kapowarr
msg_ok "Stopped $APP"
msg_info "Creating Backup"
mv /opt/kapowarr/db /opt/
msg_ok "Backup Created"
msg_info "Updating $APP to ${RELEASE}"
fetch_and_deploy_gh_release "kapowarr" "Casvt/Kapowarr"
msg_ok "Updated $APP to v${RELEASE}"
msg_info "Starting $APP"
systemctl start kapowarr
msg_ok "Started $APP"
msg_ok "Update Successful"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"
fi
exit exit
} }