view scripts/ @ 543:60b97ba66a70

Extensive semi-gratuitous refactoring: factor out common code, handle euid!=uid and egid!=gid cases. (Note: test suite requires root access, possibly container support.)
author Rob Landley <>
date Mon, 12 Mar 2012 23:00:28 -0500
parents 2428870ce50c
line wrap: on
line source


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

if [ ! -c "$1" ]
  echo "Usage: /dev/ttyS0"
  exit 1

[ -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.