overkill (was Re: How can a login script determine if the session is remotely logged in?)

Guy Harris guy at auspex.auspex.com
Wed Jul 26 10:41:21 AEST 1989


>Sure you can.  If you get a TERM type, you're rlogin, if not, itza
>telnet.

Sorry, wrong answer; the 4.3BSD version of "telnet" uses (or abuses - it
doesn't follow the protocol, but I'll let those who care one way or the
other argue the point) the "terminal type" option to "telnet" to set
TERM on the remote machine.  Said version is the basis of the one in
4.x; I don't know if it's in 3.x or not.

(Not that it matters, since they probably want the label for either
one....)

>case "$TERM" in
>sun)
>	case `tty` in
>	*ttyp*)
>		/usr/5bin/echo "\\033]lRLOGIN:`hostname`\\033\\\\";;
>	esac;;
>esac

Well, two problems with that:

	1) pseudo-ttys *do* have names that don't contain "ttyp", like
	   "ttyq0", "ttyq1", "ttyq1", etc.

	2) TERM is "sun-cmd", not "sun", in a "cmdtool" window.

Both fixable, of course, with different patterns in the "case"
construct.



More information about the Comp.unix.questions mailing list