From 831599b84adc1e57438087750aaea02ae5fc0763 Mon Sep 17 00:00:00 2001 From: jgaunt Date: Thu, 30 Jul 2020 17:22:28 -0400 Subject: [PATCH] Update 'duplicacy.sh' --- duplicacy.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/duplicacy.sh b/duplicacy.sh index 556fadf..194bf30 100644 --- a/duplicacy.sh +++ b/duplicacy.sh @@ -12,6 +12,10 @@ fi trap "rm -f ${lockfile}; exit" INT TERM EXIT echo $$ > ${lockfile} +# self update +cd $(dirname "$0") +git pull + # Duplicacy version update LATEST_DUPLICACY_VERSION="2.6.1" INSTALLED_DUPLICACY_VERSION=$(duplicacy -h | awk '/VERSION:/{getline; print $1}') @@ -50,6 +54,12 @@ if [ ${LATEST_DUPLICACY_VERSION} != ${INSTALLED_DUPLICACY_VERSION} ]; then fi fi +# check if the /.duplicacy/preferences file exists before continuing +if [ -e "/.duplicacy/preferences" ]; then + echo "ERROR: Duplicacy not yet configured. Please refer to readme file" + exit +fi + # run the backup cd / duplicacy -verbose -log backup -stats >> ${LOGFILE} 2>&1