Index: build/make-kit-remote ================================================================== --- build/make-kit-remote +++ build/make-kit-remote @@ -3,10 +3,28 @@ TARGET="$1" shift buildid="$(( hostname; id -u; pwd ) | openssl sha1 | sed 's@^.*= *@@')" workdir="/tmp/work-kitcreator-${buildid}" + +hostUp='0' +for try in {1..3}; do + checkOk="$(timeout 300 ssh -q "${TARGET}" 'echo ok' 2>/dev/null)" + + if [ "${checkOk}" = 'ok' ]; then + hostUp='1' + break + fi + + sleep 10 +done + +if [ "${hostUp}" != '1' ]; then + echo "Unable to establish a link to the remote system." >&2 + + exit 1 +fi rsync -aq --delete -e ssh . "${TARGET}:${workdir}/" || exit 1 ( newArgv=("$@"); declare -p newArgv