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