aboutsummaryrefslogtreecommitdiff
path: root/scripts/.scripts/bin-xfer
blob: e2ccce5fc94eb83ba3dc25b8d56211538d2c93eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
INFILE=/dev/null
OUTFILE=/dev/null
 
while [ $# -gt 0 ]; do
 case "$1" in
 -i)
 shift
 INFILE="$1"
 ;;
 -o)
 shift
 OUTFILE="$1"
 ;;
 -h|--help)
 echo "$0 -i infile -o outfile"
 ;;
 *)
 INFILE="$1"
 esac
 shift
done
cat << EOF
binary-xfer utility for minicom
Sending file ${INFILE} to ${OUTFILE}
EOF
 
/usr/bin/pv --force -i 0.25 -B 128  ${INFILE}  2>&1 > ${OUTFILE}
# Use the line below if you don't have pv!
 
# /bin/cat ${INFILE} > ${OUTFILE}
cat << EOF
 
File transfer complete
EOF
sleep 1