Files
heimdal/appl/kx/rxtelnet.in
Assar Westerlund 10f3cd6dbf Start the `xterm' process correctly.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@843 ec53bebd-3082-4978-b11e-865c3cabbd6b
1996-10-12 12:28:44 +00:00

39 lines
712 B
Bash

#!/bin/sh
# $Id$
if test $# -lt 1; then
echo "Usage: $0 host [arguments to telnet]"
exit 1
fi
host=$1
shift
telnet_args=$*
bindir=%bindir%
pdc_trams=`dirname $0`
PATH=$pdc_trams:$bindir:$PATH
set -- `kx $host`
if test $# -ne 3; then
exit 1
fi
pid=$1
disp=:$2
auth=$3
term=
oldifs=$IFS
IFS=:
set -- $PATH
IFS=$oldifs
for i in $*; do
test -n "$i" || i="."
for j in xterm aixterm dxterm hpterm; do
if test -x $i/$j; then
term=$j; break 2
fi
done
done
if test -n "$term"; then
($term -title $host -name $host -e env DISPLAY=$disp XAUTHORITY=$auth telnet -D $telnet_args $host; kill -USR2 $pid) &
else
env DISPLAY=$disp XAUTHORITY=$auth telnet -D $telnet_args $host
kill -USR2 $pid
fi