Fix resticw arguments line

It needs to be treated as an array so that complex commands like
`stats latest` work.
This commit is contained in:
Gerard Bosch
2022-02-08 18:51:20 +01:00
parent b5dcce5d2a
commit 59da5da0da

View File

@@ -136,11 +136,12 @@ profile_file="${ENV_DIR}/${__profile}.env.sh"
[[ ! -f "$profile_file" ]] && echo "Invalid profile: No such environment file ${profile_file}" && exit "$ERR_NO_SUCH_PROFILE"
if [[ ! -r "$profile_file" ]]; then
echo "Error: could not read the environment file ${profile_file}. Are you running this script as the correct user? Maybe try sudo with the right user."
echo "Error: Could not read the environment file ${profile_file}. Are you running this script as the correct user? Maybe try sudo with the right user."
exit "$ERR_PROFILE_NO_READ_PERM"
fi
echo -e "‣ Using profile: ${__profile} -- (${profile_file})\n"
# shellcheck disable=SC2154,SC1090
source "$profile_file" && restic "$_restic_arguments_line_"
source "$profile_file" && restic "${_restic_arguments_line_[@]}"