From 4d1b3a2a65c66d21b35cab72dd024043a92ceb1c Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Thu, 26 Mar 2020 02:47:52 -0600 Subject: [PATCH] read configuration file --- borghelper.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/borghelper.sh b/borghelper.sh index a03993f..aecf914 100644 --- a/borghelper.sh +++ b/borghelper.sh @@ -134,3 +134,19 @@ if [ "$fileName" ] && [ -z "$archiveName" ]; then consoleError 1 "Filename specified without an associated archive name." fi + +### read borg information file + +# check if file was provided as a relative or absolute path +case "${varsFile}" in + /*) + # absolute path, no need to rewrite variable + . "${varsFile}" + ;; + *) + # relative path, prepend './' to create absolute path + . "./${varsFile}" + ;; +esac + +