Determining if /dev/console = /dev/fb and not /dev/ttya

Brent Chapman capmkt!brent at uunet.uu.net
Fri Jun 23 06:57:49 AEST 1989


# I want to have my .logout script put a rasterfile on the screen when I
# logout on a workstation.  Using "if (`tty` == /dev/console)" I can reject
# logins from the dialup ports and rlogin sessions, the file server has
# /dev/ttya as its console.  My first misguided attempt to check if
# /dev/console is the same as /dev/ttya caused the server to panic with a
# bus error.  Any suggestions?

Assuming that your /etc/ttytype correctly identifies the type of your
console terminal as something other than "sun" when the console is to an
ASCII terminal through ttya, you can just check the "$TERM" environment
variable to see if it's "sun"...  For example:

    if ((`tty` == /dev/console) && ($TERM == sun)) then
	display_raster
    endif

-Brent
--
Brent Chapman					Capital Market Technology, Inc.
Computer Operations Manager			1995 University Ave., Suite 390
brent at capmkt.com				Berkeley, CA  94704
{apple,lll-tis,uunet}!capmkt!brent		Phone:  415/540-6400



More information about the Comp.sys.sun mailing list