forked from ungleich-public/ccollect
Bugfix: empty rsync_options line causes destroying source. (#8)
Bugfix: empty rsync_options line causes destroying source.
This commit is contained in:
parent
07c925de5d
commit
04bf9aff39
1 changed files with 11 additions and 1 deletions
12
ccollect
12
ccollect
|
@ -655,7 +655,17 @@ while [ "${source_no}" -lt "${no_sources}" ]; do
|
||||||
#
|
#
|
||||||
if [ -f "${c_rsync_options}" ]; then
|
if [ -f "${c_rsync_options}" ]; then
|
||||||
while read line; do
|
while read line; do
|
||||||
set -- "$@" "${line}"
|
# Trim line.
|
||||||
|
ln=$(echo "${line}" | awk '{$1=$1;print;}')
|
||||||
|
# Only if ln is non zero length string.
|
||||||
|
#
|
||||||
|
# If ln is empty then rsync '' DEST evaluates
|
||||||
|
# to transfer current directory to DEST which would
|
||||||
|
# with specific options destroy DEST content.
|
||||||
|
if [ -n "${ln}" ]
|
||||||
|
then
|
||||||
|
set -- "$@" "${ln}"
|
||||||
|
fi
|
||||||
done < "${c_rsync_options}"
|
done < "${c_rsync_options}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue