From 5fd3dce8c1e92f540abb2f6c4edd90a7be45cd06 Mon Sep 17 00:00:00 2001 From: hk Date: Mon, 26 Jun 2017 18:35:45 +0200 Subject: [PATCH] Fix for silently ignore arguments after mode broke exec mode --- src/borgwrapper.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/borgwrapper.sh b/src/borgwrapper.sh index dc98f81..8eb3dbc 100755 --- a/src/borgwrapper.sh +++ b/src/borgwrapper.sh @@ -222,7 +222,7 @@ done # Interpret all remaining arguments as mode parameters shift "$((OPTIND - 1))" -MODE="${@}" +MODE="${1}" echo "Loading config from ${CONFIG}" @@ -243,6 +243,11 @@ mkdir -p "${LOCKDIR}" # Enforce bandwidth limit if set [[ -n ${BWLIMIT} ]] && [[ ${BWLIMIT} != "0" ]] && limit_bw + if [[ ${MODE} != "exec" ]] && [[ $# -gt 1 ]]; then + print_usage + exit 1 + fi + if [[ ${MODE} == "init" ]]; then borg_init elif [[ ${MODE} == "backup" ]]; then