Just use return code from rsync. We don't mind it's verbose output being always output.

This commit is contained in:
Isaac Connor 2019-11-20 14:21:01 -05:00
parent 65222ff726
commit 0f8d2faa6f
1 changed files with 2 additions and 6 deletions

View File

@ -27,18 +27,14 @@ if [ "${TRAVIS_EVENT_TYPE}" == "cron" ] || [ "${OS}" == "debian" ] || [ "${OS}"
echo
if [ "${USE_SFTP}" == "yes" ]; then
echo "Running \$(rsync -v -e 'ssh -vvv' build/* zmrepo@zmrepo.zoneminder.com:${targetfolder}/ 2>&1)"
results="$(rsync -v -e 'ssh -vvv' build/* zmrepo@zmrepo.zoneminder.com:${targetfolder}/ 2>&1)"
if [ -z "$results" ]; then
rsync -v -e 'ssh -vvv' build/* zmrepo@zmrepo.zoneminder.com:${targetfolder}/ 2>&1
if [ $? -eq 0 ]; then
echo
echo "Files copied successfully."
echo
else
echo
echo "ERROR: Attempt to rsync to zmrepo.zoneminder.com failed!"
echo "rsync gave the following error message:"
echo \"$results\"
# Doing this again just for the output
rsync -v -e 'ssh -vvv' build/* zmrepo@zmrepo.zoneminder.com:${targetfolder}/ 2>&1
echo
exit 99
fi