- #!/bin/bash
- stty -echo
- dmesg -n 1
- function chksum (){
- echo -n "$1" | md5sum | awk '{print $1}'
- }
- function tx_data (){
- File="$1"
- if [ ! -f $File ] ; then
- echo "File $File not found."
- fi
- md5sum $File | awk '{print $1}'
- cat $File | base64 | while read -r x ; do
- Sum=$(chksum "$x")
- while true ; do
- # Send the data
- echo "$x:$Sum"
- read X < /dev/ttyS0
- X=$(echo "$X" | tr -d '\n')
- if [[ "$X" == "$1" ]] ; then
- break
- elif [[ "$X" == "quit" ]] ; then
- exit
- fi
- done
- done
- echo "EOF"
- }
- tx_data $@
xfer.sh
From Perl Marten, 5 Years ago, written in Plain Text, viewed 313 times.
URL https://paste.steamr.com/view/287eca75
Embed
Download Paste or View Raw
— Expand Paste to full width of browser