Commafeed: Fix Backup Handling while Update (#6629)

* Commafeed: Fix Backup Handling while Update

* Update commafeed.sh
This commit is contained in:
CanbiZ 2025-08-07 13:35:05 +02:00 committed by GitHub
parent ed6baa1158
commit f9e26f4f7c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -40,16 +40,20 @@ function update_script() {
$STD apt-get install -y rsync
msg_ok "Installed Dependencies"
fi
if [ -d /opt/commafeed/data ] && [ "$(ls -A /opt/commafeed/data)" ]; then
msg_info "Backing up existing data"
mv /opt/commafeed/data /opt/data.bak
msg_ok "Backed up existing data"
fi
fetch_and_deploy_gh_release "commafeed" "Athou/commafeed" "prebuild" "latest" "/opt/commafeed" "commafeed-*-h2-jvm.zip"
msg_info "Updating ${APP} to ${RELEASE}"
if [ -d /opt/commafeed/data.bak ] && [ "$(ls -A /opt/commafeed/data.bak)" ]; then
mv /opt/commafeed/data.bak /opt/commafeed/data
if [ -d /opt/data.bak ] && [ "$(ls -A /opt/data.bak)" ]; then
msg_info "Restoring data"
mv /opt/data.bak /opt/commafeed/data
msg_ok "Restored data"
fi
msg_ok "Updated ${APP} to ${RELEASE}"
msg_info "Starting ${APP}"
systemctl start commafeed