From e611c886b159b67e41278373ccd348b6c46573c9 Mon Sep 17 00:00:00 2001 From: Carlo Landmeter Date: Wed, 31 Jan 2018 00:07:00 +0000 Subject: make sure backup location and cache are set --- alpine-backup | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/alpine-backup b/alpine-backup index cf05943..446218b 100755 --- a/alpine-backup +++ b/alpine-backup @@ -9,7 +9,12 @@ else exit 1 fi -mkdir -p "$BACKUP_LOCATION" "$BACKUP_CACHE" +if [ -n "$BACKUP_LOCATION" ] && [ -n " $BACKUP_CACHE" ]; then + mkdir -p "$BACKUP_LOCATION" "$BACKUP_CACHE" +else + echo "Error: BACKUP_LOCATION and/or BACKUP_CACHE are not set!" + exit 1 +fi # set the suffix of backup files when ecryptions is enabled [ -n "$ENCRYPTION" ] && export SUFFIX=".$ENCRYPTION" -- cgit v1.2.3