diff --git a/ccollect.sh b/ccollect.sh index 163c96e..7747fcc 100755 --- a/ccollect.sh +++ b/ccollect.sh @@ -89,15 +89,13 @@ add_name() } # -# Execute on remote host, if backing up to a remote host +# Prepend "ssh ${remote_host}", if backing up to a remote host # pcmd() { - if [ "${remote_host}" ]; then - ssh "${remote_host}" "$@" - else - "$@" - fi + [ "${remote_host}" ] && set -- "ssh" "${remote_host}" "$@" + + "$@" } #