fix(restc): avoid word splitting for options

This commit is contained in:
Nicolas KAROLAK 2018-08-09 11:23:04 +02:00 committed by Jerome Charaoui
parent 2651c1ccbd
commit ca5358bc3f
2 changed files with 4 additions and 3 deletions

View File

@ -15,7 +15,7 @@ Requirements:
Recommended:
rdiff-backup duplicity rsync borgbackup gzip hwinfo sfdisk cryptsetup flashrom hwinfo
borgbackup cryptsetup duplicity flashrom gzip hwinfo rdiff-backup restic rsync sfdisk
To install backupninja, simply do the following:

View File

@ -75,8 +75,9 @@ function run_cmd {
while [ $pass -lt $retry_run ]; do
(( pass++ ))
debug "Attempt $pass"
info "Running command in a subshell. This may take a while..."
# return when cmd succeeded, pass when failed
$cmd && return 0 || :
eval $cmd && return 0 || :
sleep $retry_wait
done
@ -126,7 +127,7 @@ function run_cmd {
cmd_global_options+="--no-lock "
[ -n "$option" ] && \
cmd_global_options+="$(for i in $option; do echo "--option $i "; done)"
cmd_global_options+="$(for i in "${option[@]}"; do echo "--option $i "; done)"
[ -n "$quiet" ] && \
cmd_global_options+="--quiet "