Fix for silently ignore arguments after mode broke exec mode

dev
hk 2017-06-26 18:35:45 +02:00
parent ffc37069f9
commit 5fd3dce8c1
1 changed files with 6 additions and 1 deletions

View File

@ -222,7 +222,7 @@ done
# Interpret all remaining arguments as mode parameters # Interpret all remaining arguments as mode parameters
shift "$((OPTIND - 1))" shift "$((OPTIND - 1))"
MODE="${@}" MODE="${1}"
echo "Loading config from ${CONFIG}" echo "Loading config from ${CONFIG}"
@ -243,6 +243,11 @@ mkdir -p "${LOCKDIR}"
# Enforce bandwidth limit if set # Enforce bandwidth limit if set
[[ -n ${BWLIMIT} ]] && [[ ${BWLIMIT} != "0" ]] && limit_bw [[ -n ${BWLIMIT} ]] && [[ ${BWLIMIT} != "0" ]] && limit_bw
if [[ ${MODE} != "exec" ]] && [[ $# -gt 1 ]]; then
print_usage
exit 1
fi
if [[ ${MODE} == "init" ]]; then if [[ ${MODE} == "init" ]]; then
borg_init borg_init
elif [[ ${MODE} == "backup" ]]; then elif [[ ${MODE} == "backup" ]]; then