$! CPS$Config-printer-port.com sets a DECserver port to have the correct $! settings for printer operation. Both the volitale & non-volitle data $! bases are updated. $! $! p1 is the server name $! p2 is the port number (1 - 8) $! p3 is the privledged password $! p4 is the comm speed (9600 default) $! $! Note that many of the default settings are correct, but we are not taking $! any chances so we set them anyway. Also, by default, the speed is set $! 9600. $! $! DECservers currently supported are 100, 200, 500. $! $! Version V2.1-2 $! $! Shortcomings: $! 1) If the DECserver remote console is already in use, this proc $! will not work correctly (crash & burn). $! $! 2) If TSM$NO_PROXY is true then this proc generates some error $! message which can probably be ingnored. They can't be suppressed. $! $! 3) The server queue limit support is very crude. Basicly the default $! queue limit is set and a warning message printed out. $! $! 4) Server privledged password is typed in clear text. $! $! $! COPYRIGHT (c) 1989, 1990 BY $! DIGITAL EQUIPMENT CORPORATION, MAYNARD $! MASSACHUSETTS. ALL RIGHTS RESERVED. $! $! THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED $! ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION $! OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER COPIES $! THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER $! PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED. $! $! THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND $! SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION. $! $! DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS $! SOFTWARE ON EQUIPMENT THAT IS NOT SUPPLIED BY DIGITAL. $! $!-- $ $ on control_y then goto abort $ on error then goto abort $ set symbol /scope=(nolocal, noglobal) $ f := sys$login:cps_zz_foo.t ! Scratch file $ s := sys$login:cps_zz1_foo.t ! Another scratch file $! Check for privs. DS200 only needs OPER, DS500 needs others $! Bypass priv is sloppy, to get around not having setup TSM user proxy $! account stuff. $ privs = "OPER, BYPASS, CMKRNL" $ old_privs = f$setprv(privs) ! Privs when started $ if f$privilege(privs) .eqs. "FALSE" $ then $ write sys$error "%CPS-E-NOPRIVS, The following privs are need to run: ''privs'" $ old_privs = f$setprv(old_privs) ! Restore privs in effect at start $ exit %x10000024 ! SS$_NOPRIV, close enough $ endif $ $ inquire p1 "Server name" $ inquire p2 "Port number" $ inquire p3 "Server password" ! Since TSM keeps password in clear ! text, we don't care either. $ inquire p4 "Speed [9600]" $ if p4 .eqs. "" then p4 = 9600 $ define /nolog cps_example sys$common:[syshlp.examples.cps] $ say := write sys$output $ say "" $ say "%CPS-I-PROGRESS: Setting port characteristics..." $ tsm /server='p1' @cps_example:cps$common-port-settings 'p2' 'p3' 'p4' $ $! Now go away and figure out what kind of DECserver we have $ Gosub DS_type $! Do any DECserver type specific stuff $ if f$search("cps_example:cps$''ds_type'-port-settings.com") .nes. "" $ then $ tsm /server='p1' @cps_example:cps$'ds_type'-port-settings 'p2' 'p3' $ say "" $ say "*******************************************************************************" $ say "* *" $ say "* WARNING!! Server queue limit has been set to default value. *" $ say "* *" $ say "*******************************************************************************" $ say "" $ endif $ say "" $ say "%CPS-I-PROGRESS: Done setting port characteristics" $ $ LAT_groups: $ say "" $ say "%CPS-I-PROGRESS: Start of LAT group check" $ create 'f' ! Empty file for brain damage below $ define /user /nolog sys$output 'f' $ mcr latcp sho characteristics $ open file 'f' $ read file line/end_of_file=end_read/error=abort $ end_read: $ close file $ b = f$locate("Group", line) $ e = f$locate(")", line) $ say "" $ say "LAT groups on the system: " + f$extract(b+9, e-b-9+1, line) $ if ds_type .nes. "DS100" ! DS100 doesn't have service groups $ then $ tsm /out='f' /server='p1' show server summary $ search 'f' Groups: /out='s' $ say "" $ say "DECserver service groups: " $ type 's' $ endif $ if ds_type .eqs. "DS100" $ then $ !Unfortunately, the DS100 will only give up it's port groups in $ ! privledged mode. $ tsm /server='p1' /out='f' @cps_example:cps$get-ds100-port-groups 'p2' 'p3' $ search 'f' groups /out='s' /window=4 $ else $ tsm /server='p1' /out='f' show port 'p2' $ search 'f' groups /out='s' $ endif $ say "" $ say "DECserver port groups: " $ type 's' $ say "" $ say "At least one group must in all the settings." $ say "" $ inquire /nopunc a "Update LAT groups [N]? " $ if a $ then $ gosub Fix_system_groups $ gosub fix_DECserver_groups $ endif $ say "$CPS-I-PROGRESS: End of LAT group check" $ $! For DS500, save the port settings or else they will be reset by server $! when it does its periodic reset (this is really dumb). $ if ds_type .eqs. "DS500" then - tsm/server='p1' @cps_example:cps$save-ds500-port 'p2' 'p3' $ Abort: $ old_privs = f$setprv(old_privs) $ if f$search(f) .nes. "" then delete 'f'.* /nolog /noconfirm $ if f$search(s) .nes. "" then delete 's'.* /nolog /noconfirm $ exit $ $!+----- $ DS_type: $! $! Figures out what type of DECserver we have, e.g. DS200 and stores that $! in the symbol ds_type. $!------ $ $ tsm /out='f' show server 'p1' $ search 'f' Type: /out='s' $ open file 's' $ read file ds_type/end=eof $ eof: $ close file $ ds_type = f$edit(ds_type, "TRIM, COMPRESS") $ ds_type = f$element(1," ",ds_type) $ return $ $!+----- $ Fix_system_groups: $! $! Handles adding LAT groups on your system. $!------ $ $ inquire a "Group(s) to add to your system (Groups, or RETURN for no change)" $ if a .nes. "" $ then $ define /user /nolog sys$output nl: $ mcr latcp set node /enable=('a') $ endif $ return $ $!+----- $ Fix_DECserver_groups: $! $! Handles adding LAT groups to a DECserver $!------ $ $ inquire a "Group(s) to add to your DECserver (Groups, or RETURN for no change)" $ if a .nes. "" $ then $ if ds_type .eqs. "DS100" $ then $ tsm /server='p1' @cps_example:cps$set-ds100-groups 'p2' 'p3' 'a' $ else $ tsm /server='p1' @cps_example:cps$set-ds-groups 'p2' 'p3' 'a' $ endif $ endif $ return