This commit is contained in:
Slaviša Arežina
2025-07-24 21:00:41 +02:00
committed by GitHub
parent af4aedf15a
commit d956763642
2 changed files with 7 additions and 20 deletions

View File

@@ -27,25 +27,19 @@ function update_script() {
msg_error "No ${APP} Installation Found!"
exit
fi
RELEASE=$(curl -fsSL https://api.github.com/repos/duplicati/duplicati/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}')
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
if [[ "${RELEASE}" != "$(cat ~/.duplicati)" ]] || [[ ! -f ~/.duplicati ]]; then
msg_info "Stopping $APP"
systemctl stop duplicati
msg_ok "Stopped $APP"
msg_info "Updating $APP to v${RELEASE}"
curl -fsSL "https://github.com/duplicati/duplicati/releases/download/v${RELEASE}/duplicati-${RELEASE}-linux-x64-gui.deb" -o $(basename "https://github.com/duplicati/duplicati/releases/download/v${RELEASE}/duplicati-${RELEASE}-linux-x64-gui.deb")
$STD dpkg -i duplicati-${RELEASE}-linux-x64-gui.deb
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated $APP to v${RELEASE}"
fetch_and_deploy_gh_release "duplicati" "duplicati/duplicati" "binary" "latest" "/opt/duplicati" "linux-x64-gui.deb"
msg_info "Starting $APP"
systemctl start duplicati
msg_ok "Started $APP"
msg_info "Cleaning Up"
rm -rf ~/duplicati-${RELEASE}-linux-x64-gui.deb
msg_ok "Cleanup Completed"
msg_ok "Update Successful"
else
msg_ok "No update required. ${APP} is already at v${RELEASE}"