host.rc
author Claus Gittinger <cg@exept.de>
Thu, 07 Nov 1996 12:34:01 +0100
changeset 165 bb77927038c7
parent 123 a974136fe017
child 169 08055578224e
permissions -rw-r--r--
*** empty log message ***

"*
 * $Header$
 *
 * DONT add site specific things here - use your own h_xxx.rc file instead
 * where xxx stands for your hostname(s)
 *
 * startup configuration for host specific stuff -
 * looks for a host specific init file and loads it.
 *"

|host domain s|

"/ on some systems, paging in  is so slow, that a SIGALRM
"/ arrives too early to be handled correctly 
"/ (I guess, this is my fault somewhere ... ;-)
"/
"/ This can be worded around by disabling the timer here.
"/ (The sceduler will reenable it later)

(OperatingSystem getSystemType = 'hpux') ifTrue:[
    OperatingSystem disableSignal:(OperatingSystem sigALRM)
].

"/
"/ setup the printer stuff.
"/ the commands below will be offered in the printer-setting box
"/
PostscriptPrinterStream defaultCommands:#(
				    'lpr -h'
				    'cat | rsh <hostname> lpr -h'
				    'cat > preview.ps'
				    'cat > preview.ps; ghostview preview.ps'
			     ).

PrinterStream defaultCommands:#(
				    'lpr -h'
				    'cat | rsh <hostname> lpr -h'
				    'a2ps | rsh <hostname> lpr -h'
				    'a2ps > preview.ps; ghostview preview.ps'
			     ).

Printer := PrinterStream.
"/ Printer := PostscriptPrinterStream.
PostscriptPrinterStream printCommand:'lpr'.
PrinterStream printCommand:'lpr'.

"/ in our home-domain, preset the print command for remote printing
"/ on a host called 'ibm'.
"/ You can change this for your environment and/or make it
"/ unconditional.

domain := OperatingSystem getDomainName.
(domain = 'xaxept.de' or:[domain = 'exept.de']) ifTrue:[
    PostscriptPrinterStream printCommand:'cat | rsh ibm lpr -h'.
    PrinterStream printCommand:'cat | rsh ibm lpr -h'.
    PostscriptPrinterStream defaultCommands:#(
				    'cat | rsh ibm lpr -h'
				    'cat > preview.ps'
				    'cat > preview.ps; ghostview preview.ps'
			     ).
    PrinterStream defaultCommands:#(
				    'cat | rsh ibm lpr -h'
				    'a2ps | rsh ibm lpr -h'
				    'a2ps > preview.ps; ghostview preview.ps'
			     ).
].

"/
"/ try host-specific setup
"/ (h_<hostname>.rc
"/
host := OperatingSystem getHostName.
host isNil ifTrue:[
    'cannot determine host I am running on' errorPrintCR.
] ifFalse:[
    "if there is a corresponding file ..."

    (Smalltalk at:#'_ImageHostName') ~= host ifTrue:[
	('trying host setup h_' , host , '.rc ...') infoPrintCR.

	s := Smalltalk systemFileStreamFor:('h_' , host , '.rc').
	s notNil ifTrue:[
	    s fileIn.
	    s close.
	].
	Smalltalk at:#'_ImageHostName' put:host.
    ]
].
!