Skip to content

Instantly share code, notes, and snippets.

@frojnd
Created April 3, 2020 13:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frojnd/d90892169fe51bbac1ca817a808cc65e to your computer and use it in GitHub Desktop.
Save frojnd/d90892169fe51bbac1ca817a808cc65e to your computer and use it in GitHub Desktop.
function loop_through_tty {
log_path="$HOME/logs"
if [ ! -d "$log_path" ]; then
mkdir $log_path
fi
while true
do
for i in $(find /dev/ |grep ttyUSB); do
if [[ -z $(ps fax |grep picocom |grep $i |grep -v grep) ]]; then
screen picocom -b 115200 -l $i --logfile $log_path/picocom${i##*/}.log
fi
done
sleep 2s;
done
}
loop_through_tty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment