#!/bin/bash
# example : make a slip link through a telnet session.
#
#           start the script to link  ttyze <--> ttyzf ,
#           connect in the telnet session   open <host> <port> ,
#           start an ip emulator at the remote host (slirp, sliplogin, ...),
#           connect ttyze to a slip interface (slattach -p slip ttyze)
#

# old method
# if [ ! -p pipe ]; then mknod pipe p; fi
# cat pipe |cu -l /dev/ptyze -E '' --nostop \
#  |cu -l /dev/ptyzf -E '' --nostop >pipe &

forktty -f -l /dev/ptyze -- forktty -f -l /dev/ptyzf -p
( sleep 2 && forktty -l /dev/ttyze -c 'exec telnet -8 -E' ) &
cu -l /dev/ttyzf
