From b41a25c94c42fc211158f5a54c6f4209f8d29bc4 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Sun, 14 Oct 2018 06:24:37 -0600 Subject: [PATCH] Verify borg SSH keyfile exists --- backup.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backup.sh b/backup.sh index bfb85ed..b026931 100755 --- a/backup.sh +++ b/backup.sh @@ -442,6 +442,14 @@ if [ -z "${borgConfig[1]}" ]; then cleanup quit 211 else + checkExist ff "${borgConfig[1]}" + checkResult="$?" + if [ "$checkResult" = 1 ]; then + # SSH keyfile specified could not be found + cleanup + quit 211 + fi + echo -e "${op}${stamp} Borg SSH key... OK${normal}" >> "$logFile" export BORG_RSH="ssh -i ${borgConfig[1]}" fi # check: name of borg repo