From 70608d41f2ee94330260194525b9c42f5c3e73d4 Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Sun, 19 Mar 2023 13:43:10 -0400 Subject: [PATCH] Update error checking during btcpay restore. --- btcpayserver/restore.sh | 4 ---- deploy.sh | 7 ++++++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/btcpayserver/restore.sh b/btcpayserver/restore.sh index 7e09e0f..0ddf055 100755 --- a/btcpayserver/restore.sh +++ b/btcpayserver/restore.sh @@ -26,8 +26,4 @@ if [ -f "$BACKUP_BTCPAY_ARCHIVE_PATH" ]; then # now, we're going to take things down because aparently we this needs to be re-exececuted. ssh "$FQDN" "bash -c $BTCPAY_SERVER_APPPATH/btcpay-down.sh" - -else - echo "ERROR: File does not exist." - exit 1 fi diff --git a/deploy.sh b/deploy.sh index 8ec6cc3..a0daf86 100755 --- a/deploy.sh +++ b/deploy.sh @@ -134,7 +134,12 @@ for i in "$@"; do done if [ "$RESTORE_BTCPAY" = true ] && [ -z "$BACKUP_BTCPAY_ARCHIVE_PATH" ]; then - echo "ERROR: BACKUP_BTCPAY_ARCHIVE_PATH was not set event when the RESTORE_BTCPAY = true. " + echo "ERROR: Use the '--backup-archive-path=/path/to/btcpay/archive.tar.gz' option when restoring btcpay server." + exit 1 +fi + +if [ "$RESTORE_BTCPAY" = true ] && [ ! -f "$BACKUP_BTCPAY_ARCHIVE_PATH" ]; then + echo "ERROR: The backup archive path you specified DOES NOT exist!" exit 1 fi