Add options: -l username, -t args_to_telnet, and -x args_to_xterm

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@975 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1996-11-16 16:30:12 +00:00
parent 5ee1f5851a
commit acc9df43fc

View File

@@ -1,12 +1,24 @@
#!/bin/sh #!/bin/sh
# $Id$ # $Id$
#
usage="Usage: $0 [-l username] [-t args_to_telnet] [-x args_to_xterm] host"
while true
do
case $1 in
-l) telnet_args="${telnet_args} -l $2 "; title="${2}@"; shift 2;;
-t) telnet_args="${telnet_args} $2 "; shift 2;;
-x) xterm_args="${xterm_args} $2 "; shift 2;;
-*) echo "$0: Bad option $1"; echo $usage; exit 1;;
*) break;;
esac
done
if test $# -lt 1; then if test $# -lt 1; then
echo "Usage: $0 host [arguments to telnet]" echo $usage
exit 1 exit 1
fi fi
host=$1 host=$1
title="${title}${host}"
shift shift
telnet_args=$*
bindir=%bindir% bindir=%bindir%
pdc_trams=`dirname $0` pdc_trams=`dirname $0`
PATH=$pdc_trams:$bindir:$PATH PATH=$pdc_trams:$bindir:$PATH
@@ -32,7 +44,7 @@ for i in $*; do
done done
done done
if test -n "$term"; then if test -n "$term"; then
($term -title $host -name $host -e env DISPLAY=$disp XAUTHORITY=$auth telnet -D $telnet_args $host; kill -USR2 $pid) & ($term -title $title -name $title $xterm_args -e env DISPLAY=$disp XAUTHORITY=$auth telnet -D $telnet_args $host; kill -USR2 $pid) &
else else
env DISPLAY=$disp XAUTHORITY=$auth telnet -D $telnet_args $host env DISPLAY=$disp XAUTHORITY=$auth telnet -D $telnet_args $host
kill -USR2 $pid kill -USR2 $pid