new argument '-w term_emulator' for specifiying which terminal
emulator to use. Based on a patch from <arve@nada.kth.se>. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1836 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# $Id$
|
# $Id$
|
||||||
#
|
#
|
||||||
usage="Usage: $0 [-l username] [-k] [-t args_to_telnet] [-x args_to_xterm] host [port]"
|
usage="Usage: $0 [-l username] [-k] [-t args_to_telnet] [-x args_to_xterm] [-w term_emulator] host [port]"
|
||||||
|
term=
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
case $1 in
|
case $1 in
|
||||||
@@ -9,6 +10,7 @@ do
|
|||||||
-t) telnet_args="${telnet_args} $2 "; shift 2;;
|
-t) telnet_args="${telnet_args} $2 "; shift 2;;
|
||||||
-x) xterm_args="${xterm_args} $2 "; shift 2;;
|
-x) xterm_args="${xterm_args} $2 "; shift 2;;
|
||||||
-k) kx_args="${kx_args} -k"; shift;;
|
-k) kx_args="${kx_args} -k"; shift;;
|
||||||
|
-w) term=$2; shift 2;;
|
||||||
-*) echo "$0: Bad option $1"; echo $usage; exit 1;;
|
-*) echo "$0: Bad option $1"; echo $usage; exit 1;;
|
||||||
*) break;;
|
*) break;;
|
||||||
esac
|
esac
|
||||||
@@ -32,19 +34,20 @@ screen=`echo $DISPLAY | sed -ne 's/[^:]*:[0-9]*\(\.[0-9]*\)/\1/p'`
|
|||||||
pid=$1
|
pid=$1
|
||||||
disp=${2}${screen}
|
disp=${2}${screen}
|
||||||
auth=$3
|
auth=$3
|
||||||
term=
|
|
||||||
oldifs=$IFS
|
oldifs=$IFS
|
||||||
IFS=:
|
IFS=:
|
||||||
set -- $PATH
|
set -- $PATH
|
||||||
IFS=$oldifs
|
IFS=$oldifs
|
||||||
for i in $*; do
|
if test -z "$term"; then
|
||||||
test -n "$i" || i="."
|
for i in $*; do
|
||||||
for j in xterm aixterm dxterm hpterm; do
|
test -n "$i" || i="."
|
||||||
if test -x $i/$j; then
|
for j in xterm dtterm aixterm dxterm hpterm; do
|
||||||
term=$j; break 2
|
if test -x $i/$j; then
|
||||||
fi
|
term=$j; break 2
|
||||||
|
fi
|
||||||
|
done
|
||||||
done
|
done
|
||||||
done
|
fi
|
||||||
if test -n "$term"; then
|
if test -n "$term"; then
|
||||||
($term -title $title -name $title $xterm_args -e env DISPLAY=$disp XAUTHORITY=$auth telnet -D $telnet_args $host $port; kill -USR2 $pid) &
|
($term -title $title -name $title $xterm_args -e env DISPLAY=$disp XAUTHORITY=$auth telnet -D $telnet_args $host $port; kill -USR2 $pid) &
|
||||||
else
|
else
|
||||||
|
@@ -1,7 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# $Id$
|
# $Id$
|
||||||
#
|
#
|
||||||
usage="Usage: $0 [-l username] [-k] [-r rsh_args] [-x xterm_args] host"
|
usage="Usage: $0 [-l username] [-k] [-r rsh_args] [-x xterm_args] [-w term_emulator] host"
|
||||||
|
term=xterm
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
case $1 in
|
case $1 in
|
||||||
@@ -9,12 +10,13 @@ do
|
|||||||
-r) rsh_args="${rsh_args} $2 "; shift 2;;
|
-r) rsh_args="${rsh_args} $2 "; shift 2;;
|
||||||
-x) xterm_args="${xterm_args} $2 "; shift 2;;
|
-x) xterm_args="${xterm_args} $2 "; shift 2;;
|
||||||
-k) kx_args="${kx_args} -k"; shift;;
|
-k) kx_args="${kx_args} -k"; shift;;
|
||||||
|
-w) term=$2; shift 2;;
|
||||||
-*) echo "$0: Bad option $1"; echo $usage; exit 1;;
|
-*) echo "$0: Bad option $1"; echo $usage; exit 1;;
|
||||||
*) break;;
|
*) break;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
if test $# -lt 1; then
|
if test $# -lt 1; then
|
||||||
echo "Usage: $0 host [arguments to xterm]"
|
echo "Usage: $0 host [arguments to $term]"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
host=$1
|
host=$1
|
||||||
@@ -32,4 +34,4 @@ pid=$1
|
|||||||
disp=${2}${screen}
|
disp=${2}${screen}
|
||||||
auth=$3
|
auth=$3
|
||||||
kill -USR1 $pid
|
kill -USR1 $pid
|
||||||
rsh -n $rsh_args $host "env DISPLAY=$disp XAUTHORITY=$auth xterm -T $title -n $title $xterm_args &"
|
rsh -n $rsh_args $host "env DISPLAY=$disp XAUTHORITY=$auth $term -T $title -n $title $xterm_args &"
|
||||||
|
Reference in New Issue
Block a user