Created
May 12, 2024 15:33
-
-
Save libcrack/59c6f6e06e56a6f6535729f137f53314 to your computer and use it in GitHub Desktop.
Minicom file transfer helper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
INFILE=/dev/null | |
OUTFILE=/dev/null | |
if [ ${#} -lt 1 ]; then | |
echo "Usage: ${0} -i infile -o outfile" | |
exit 1 | |
fi | |
while [ ${#} -gt 0 ]; do | |
case "${1}" in | |
-i) | |
shift | |
INFILE="${1}" | |
;; | |
-o) | |
shift | |
OUTFILE="${1}" | |
;; | |
-h|--help) | |
echo "Usage: ${0} -i infile -o outfile" | |
exit 1 | |
;; | |
*) | |
echo "Usage: ${0} -i infile -o outfile" | |
exit 1 | |
;; | |
esac | |
shift | |
done | |
echo "binary-xfer utility for minicom" | |
echo "Sending file ${INFILE} to ${OUTFILE}" | |
# /usr/bin/pv --force -i 0.25 -B 128 ${INFILE} 2>&1 > ${OUTFILE} | |
/bin/cat "${INFILE}" > "${OUTFILE}" | |
echo "File transfer complete" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment