Fix shellcheck warnings
diff --git a/functions/rsync.sh b/functions/rsync.sh
index eabdf20..b221f47 100644
--- a/functions/rsync.sh
+++ b/functions/rsync.sh
@@ -94,6 +94,7 @@
rsync_create_dir() {
local RSYNCPATH=$1
if ! rsync_list_dirs "${RSYNCPATH%/*}" &>/dev/null ; then
+ [ "${RSYNCPATH%/*}" == "${RSYNCPATH}" ] && fail_exit "[FAIL] Can't reach to the rsync root"
rsync_create_dir "${RSYNCPATH%/*}"
fi
if ! rsync_list_dirs "${RSYNCPATH}" &>/dev/null ; then
@@ -162,7 +163,8 @@
[ -z "$FOLDERNAME" ] && FOLDERNAME=${SRCDIR##*/}
# Lock source dir to prevent concurent sync stage
- job_lock ${SRCDIR}.lock wait
+ local LOCK_FILE=${SRCDIR}.lock
+ job_lock "$LOCK_FILE" wait
rsync_list_dirs "${RSYNCPATH}/$FILESDIR" &>/dev/null \
|| rsync_create_dir "${RSYNCPATH}/$FILESDIR"
@@ -211,7 +213,7 @@
fi
# Unlock source dir
- job_lock ${SRCDIR}.lock unset
+ job_lock "$LOCK_FILE" unset
return $RESULT
}