Skip to content

Commit

Permalink
Handle backup upload failure (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukechilds committed Sep 2, 2020
1 parent a88541a commit 9363d62
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/backup/backup
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ if [[ $BITCOIN_NETWORK == "regtest" ]]; then
fi

echo "Uploading backup..."
curl --socks5 localhost:9150 -F "file=@/${BACKUP_FILE}" "${BACKUP_API_URL}/${backup_id}"
if curl --socks5 localhost:9150 -F "file=@/${BACKUP_FILE}" "${BACKUP_API_URL}/${backup_id}"; then
status="===== Backup successful ====="
else
status="======= Backup failed ======="
fi
echo

rm -rf "${BACKUP_ROOT}"
Expand All @@ -126,7 +130,7 @@ echo "Removing lock..."
rm -f "${UMBREL_ROOT}/statuses/backup-in-progress"

echo "============================="
echo "===== Backup successful ====="
echo "${status}"
echo "============================="

exit 0

0 comments on commit 9363d62

Please sign in to comment.