view scripts/minicom.sh @ 1315:0f42d83199a9 draft

logname and whoami are the same as id -un, so merge them. Since the starting letters are greater than those for 'id' or 'groups', we cn just check if the first letter is greater than 'i'.
author Isaac Dunham <ibid.ag@gmail.com>
date Sun, 25 May 2014 11:46:58 -0500
parents 2428870ce50c
children
line wrap: on
line source

#!/bin/bash

# If you want to use toybox netcat to talk to a serial port, use this.

if [ ! -c "$1" ]
then
  echo "Usage: minicom.sh /dev/ttyS0"
  exit 1
fi

SPEED="$2"
[ -z "$SPEED" ] && SPEED=115200

stty $SPEED -F "$1"
stty raw -echo -ctlecho -F "$1"
stty raw -echo  # Need to do it on stdin, too.
./toybox netcat -f "$1"
stty cooked echo  # Put stdin back.