From 91eaa1a781e6101206def90a9b620ebf70419085 Mon Sep 17 00:00:00 2001 From: "Hahn Axel (hahn)" <axel.hahn@iml.unibe.ch> Date: Fri, 29 Jan 2021 14:21:12 +0100 Subject: [PATCH] 2021-01-29 bort on empty passphrase --- transfer.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/transfer.sh b/transfer.sh index 9e9e6e2..132aaaa 100755 --- a/transfer.sh +++ b/transfer.sh @@ -31,6 +31,7 @@ # 2019-10-30 ah,ds v1.9 for rsync targets: create remote target dir with ssh command # 2020-01-21 ah,ds v1.10 show colored OK or FAILED at the end of output # 2020-02-25 ah,ds, v1.11 fix test -z with non existing vars; show final backup status +# 2021-01-29 ah,ds, v1.12 abort on empty passphrase # ================================================================================ @@ -112,9 +113,6 @@ cat "${lockfile}" color reset echo - echo if no process was found then delete the lockfile - ls -l "${lockfile}" - echo # 1659 - check process id inside the lock file # detect pid from lockfile and search for this process @@ -170,6 +168,12 @@ PASSPHRASE=`_j_getvar ${STORAGEFILE} "gnupg-passphrase"` + if [ -z "${PASSPHRASE}" ]; then + echo "ERROR: no value gnupg-passphrase was set in ${STORAGEFILE} to encrypt backup data." + echo "Aborting." + exit 1 + fi + sParamExclude= # build exclude param list for duplicity # -- GitLab