Compare commits

...

2 Commits

Author SHA1 Message Date
f9540cc065 Improve printing 2025-01-27 22:59:26 +01:00
945a5ea3dd Fix arg parsing 2025-01-27 22:55:20 +01:00

View File

@@ -29,12 +29,14 @@ 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 $key failed with exit code $?:"
echo "$output" echo "$output"
else else
echo "Backup of $i successful:" echo "Backup of $key successful:"
echo "$output" echo "$output"
fi fi