Commafeed: Fix Backup Handling while Update (#6629)
* Commafeed: Fix Backup Handling while Update * Update commafeed.sh
This commit is contained in:
parent
ed6baa1158
commit
f9e26f4f7c
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user