#!/bin/bash HOST=zzz if [ "$HOSTNAME" != $HOST ]; then echo "Connecting to $HOST (ssh)" exec ssh -t $HOST $0 fi # nullmodem port TTY=/dev/ttyS0 BAUD=115200 # TARGET_TTY=$TTY,raw,echo=0,cr,igncr=1,ixon=1,b$BAUD,cr3 # CONSOLE_TTY=- TARGET_TTY=$TTY,b$BAUD,raw,echo=0 # treat console end as a terminal. run this in an xterm or emacs # terminal emulator. CONSOLE_TTY=`tty`,raw,echo=0 # give the argument "-" to run without console special keys, i.e. in # an emacs shell buffer. [ -z "$1" ] || CONSOLE_TTY=$1 echo "Connecting $TARGET_TTY to $CONSOLE_TTY" exec socat $TARGET_TTY $CONSOLE_TTY echo Failed.