Skip to content

Instantly share code, notes, and snippets.

@libcrack
Created May 12, 2024 15:33
Show Gist options
  • Save libcrack/59c6f6e06e56a6f6535729f137f53314 to your computer and use it in GitHub Desktop.
Save libcrack/59c6f6e06e56a6f6535729f137f53314 to your computer and use it in GitHub Desktop.
Minicom file transfer helper
#!/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