Fix arg parsing
This commit is contained in:
parent
8722afe2c8
commit
945a5ea3dd
@ -29,7 +29,9 @@ if [ -n "$BACKUP_HELPER_COMMANDS" ]; then
|
|||||||
for pair in "${pairs[@]}"; do
|
for pair in "${pairs[@]}"; do
|
||||||
IFS=":" read -r key value <<< "$pair"
|
IFS=":" read -r key value <<< "$pair"
|
||||||
|
|
||||||
if ! output=$(restic backup --stdin-filename "$key" --stdin-from-command -- "$value"); then
|
# Split value into array of command args
|
||||||
|
IFS=' ' read -r -a cmd_parts <<< "$value"
|
||||||
|
if ! output=$(restic backup --stdin-filename "$key" --stdin-from-command -- "${cmd_parts[@]}"); then
|
||||||
exit_code=1;
|
exit_code=1;
|
||||||
echo "Backup of $i failed with exit code $?:"
|
echo "Backup of $i failed with exit code $?:"
|
||||||
echo "$output"
|
echo "$output"
|
||||||
|
Loading…
Reference in New Issue
Block a user