transfer.sh 580 B

123456789101112131415161718192021222324
  1. # $OpenBSD: transfer.sh,v 1.4 2017/04/30 23:34:55 djm Exp $
  2. # Placed in the Public Domain.
  3. tid="transfer data"
  4. rm -f ${COPY}
  5. ${SSH} -n -q -F $OBJ/ssh_proxy somehost cat ${DATA} > ${COPY}
  6. if [ $? -ne 0 ]; then
  7. fail "ssh cat $DATA failed"
  8. fi
  9. cmp ${DATA} ${COPY} || fail "corrupted copy"
  10. for s in 10 100 1k 32k 64k 128k 256k; do
  11. trace "dd-size ${s}"
  12. rm -f ${COPY}
  13. dd if=$DATA obs=${s} 2> /dev/null |
  14. ${SSH} -q -F $OBJ/ssh_proxy somehost "cat > ${COPY}"
  15. if [ $? -ne 0 ]; then
  16. fail "ssh cat $DATA failed"
  17. fi
  18. cmp $DATA ${COPY} || fail "corrupted copy"
  19. done
  20. rm -f ${COPY}