home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / ckv196.zip / ckermit.ini < prev    next >
Text File  |  2000-01-01  |  22KB  |  625 lines

  1. #!/usr/local/bin/kermit
  2. COMMENT - Standard C-Kermit initialization file
  3. ;
  4. ; For C-Kermit Version: 7.0.196 (but can also be used by 6.0.192)
  5. ;
  6. ; Filename:
  7. ;   .kermrc     (UNIX, OS-9, Aegis)
  8. ;   CKERMIT.INI (OS/2, VMS, OpenVMS, AOS/VS, Atari ST, Commodore Amiga)
  9. ;   ckermit.ini (Stratus VOS)
  10. ;   K95.INI     (Kermit 95 -- but this big version is not used there)
  11. ;   K2.INI      (Kermit/2  -- but ditto)
  12. ;
  13. ; Authors:
  14. ;   Frank da Cruz, Christine M. Gianone, Jeffrey Altman
  15. ;   Columbia University, New York, NY 10025-7799, USA
  16. ;
  17. ; Version 5A(188): 23 November 1992
  18. ; Version 5A(189): 29 June 1993
  19. ; Version 5A(190): 04 October 1994
  20. ; Version 5A(191): 17 April 1995
  21. ; Version 6.0.192:  6 September 1996
  22. ; Version 7.0.196:  1 January 2000
  23. ;
  24. ; This is the standard and recommended C-Kermit 7.0 initialization file.  To
  25. ; override settings or definitions made in this file, to add new settings or
  26. ; definitions, or to make any other desired customizations, create a separate,
  27. ; personal customization file called:
  28. ;
  29. ;   .mykermrc     (UNIX, OS-9, Aegis, BeBox, Plan 9)
  30. ;   CKERMOD.INI   (OS/2, VMS, OpenVMS, AOS/VS, Atari ST, Commodore Amiga)
  31. ;   ckermod.ini   (VOS)
  32. ;
  33. ; You can also define the customization filename in an environment
  34. ; variable (logical name in VMS), CKERMOD, which takes precedence over
  35. ; the names shown above.
  36. ;
  37. ; WHAT THIS FILE DOES:
  38. ;
  39. ; . The FULLSCREEN file transfer display is selected if it is available
  40. ; . Defines your default dialing directory name:
  41. ;     .kdd for UNIX, OS-9 and Aegis; CKERMIT.KDD for other operating systems.
  42. ;        You can override this with the environment variable K_DIAL_DIRECTORY
  43. ; . Defines your default network directory name:
  44. ;     .knd for UNIX, OS-9 and Aegis; CKERMIT.KND for other operating systems.
  45. ;        You can override this with the environment variable K_NET_DIRECTORY
  46. ; . Defines your default services directory name:
  47. ;     .ksd for UNIX, OS-9 and Aegis; CKERMIT.KSD for other operating systems.
  48. ;        You can override this with environment variable K_SERVICE_DIRECTORY.
  49. ; . Defines your customization file name (name given above)
  50. ; . Performs system-dependent setups for UNIX, VMS, OS/2, etc.
  51. ; . Defines an EDIT macro to let you invoke a text editor from C-Kermit.
  52. ; . Defines TSEND, BSEND, TGET, BGET macros for text and binary file transfer.
  53. ; . Defines VTPRINT, PCGET, and PCSEND macros for use with MS-DOS Kermit, etc.
  54. ; . Opens your dialing directory if you have one.
  55. ; . Reads your services directory and defines ACCESS and LIST macros for it.
  56. ; . Executes your personal customization file, if you have one.
  57. ;
  58. ; C-Kermit 6.0 is documented in the book "Using C-Kermit", 2nd Edition,
  59. ; by Frank da Cruz and Christine M. Gianone, 1997, Digital Press /
  60. ; Butterworth-Heinemann, ISBN 1-55558-164-1.  Updates are described in the
  61. ; text file, ckermit2.txt.
  62.  
  63. ; Everything after this point depends on the script programming language.
  64. ; The CHECK command terminates this command file immediately if the script
  65. ; programming language (IF command) is not configured.
  66. ;
  67. set take error on        ; This makes CHECK quit if no script language.
  68. check if            ; Do we have an IF command?  If not, quit now.
  69. set take error off        ; Back to normal.
  70.  
  71. local _sd _servicedir _xp       ; Declare local variables.
  72.  
  73. COMMENT - C-Kermit version 6.0 or later required.
  74. ;
  75.  
  76. asg _xp \v(xprogram)
  77. if not def _xp asg _xp \v(program)
  78. if not equal "\m(_xp)" "C-Kermit" -
  79.   stop 1 \v(cmdfile): This initialization file is only for C-Kermit.
  80. echo Executing \v(cmdfile) for \v(system)...
  81. if < \v(version) 60000 -
  82.   stop 1 \v(cmdfile): C-Kermit 6.0 or later required.
  83.  
  84. forward \v(system)        ; First do system-dependent items...
  85.  
  86. :unknown            ; Should not happen
  87. Stop 1 Error: System type unknown!
  88.  
  89. :Aegis                ; Apollo Aegis and
  90. :UNIX                ; UNIX, all versions
  91. asg _myinit -
  92.   \v(home).mykermrc        ; Customization filename
  93. if remote forward COMMON        ; Skip local-mode items if "-R"
  94. asg _dialdir -
  95.   \v(home).kdd            ; C-Kermit dialing directory
  96. asg _netdir -
  97.   \v(home).knd            ; C-Kermit network directory
  98. asg _servicedir -
  99.   \v(home).ksd            ; C-Kermit services directory
  100. if \findex(IRIX,\v(platform)) -
  101.  set send packet-length 4000    ; Bug in IRIX Telnet server.
  102. forward COMMON                  ; End of UNIX section
  103.  
  104. :OS9/68K            ; OS-9
  105. asg _myinit -
  106.   \v(home).mykermrc        ; Customization filename
  107. if remote forward COMMON
  108. asg _dialdir -
  109.   \v(home).kdd            ; C-Kermit dialing directory
  110. asg _netdir -
  111.   \v(home).knd            ; C-Kermit network directory
  112. asg _servicedir -
  113.   \v(home).ksd            ; C-Kermit services directory
  114. if eq "\$(TERM)" "vt100" -      ; File transfer display
  115.   set file display full         ; Only works with VT-100 terminal type
  116. else if eq "\$(TERM)" "VT100" -
  117.   set file display full
  118. else set file display crt
  119. forward COMMON            ; End of OS-9 section
  120.  
  121. :VMS                ; VMS and OpenVMS
  122. forward COMMON
  123.  
  124. :OS/2                ; Kermit 95
  125. :WIN32
  126. echo This initialization file is not for use with K95.
  127. forward COMMON                  ; End of OS/2 section
  128.  
  129. :AOS/VS                ; Data General AOS/VS
  130. set window 1            ; Sliding windows don't work
  131. set file char dg-international    ; File character-set
  132. set xfer char latin1        ; Transfer character-set
  133. set file display crt            ; File transfer fisplay
  134. def cli push            ; Escape to CLI
  135. def reset -            ; Macro to reset DG DASHER terminal
  136.  run write [!ascii 236 306 301]
  137. forward COMMON                  ; End of AOS/VS section
  138.  
  139. :Amiga                ; Commodore Amiga
  140. def cls echo \27[H\27[2J    ; CLS command to clear the screen
  141. set file display full           ; Supports fullscreen display
  142. set file char latin1        ; Use Latin Alphabet 1 for file transfer
  143. set xfer char latin1        ; ...
  144. forward COMMON                  ; End of Amiga section
  145.  
  146. :Atari_ST            ; Atari ST
  147. def cls echo \27H\27J        ; Clear screen a`la VT52
  148. set file display crt        ; FULLSCREEN not available
  149. set server display on        ; Show file xfer display in server mode too
  150. set server timeout 15        ; Nonzero required for ^C interruption!
  151. forward COMMON                  ; End of Atari ST section
  152.  
  153. :Macintosh            ; Apple Macintosh
  154. set server display on        ; Show file xfer display in server mode too.
  155. forward COMMON
  156.  
  157. :Stratus_VOS                    ; Stratus VOS
  158. asg _myinit \v(home)ckermod.ini
  159. if remote forward COMMON
  160. asg _dialdir \v(home)ckermit.kdd
  161. asg _netdir \v(home)ckermit.knd
  162. asg _servicedir \v(home)ckermit.ksd
  163. set file display crt        ; FULLSCREEN not available
  164. forward COMMON                  ; End of Stratus VOS section
  165.  
  166. :COMMON                ; For all systems
  167.  
  168. ; Define macros that are useful when running C-Kermit in remote mode.
  169. ; These macros serve no purpose on local-mode-only versions such as
  170. ; OS/2, Macintosh, Amiga, and Atari ST Kermit, so we skip defining them
  171. ; for those systems.
  172. ;
  173. if not = 0 \findex(\v(system),WIN32:OS/2:Macintosh:Amiga:Atari_ST) -
  174.   forward files
  175.  
  176. ; VTPRINT macro.  Print a file on your PC's local printer.
  177.  
  178. def VTPRINT echo \27[5i, type \%1, echo \27[4i
  179. ; or if your printer needs a formfeed to force the page out:
  180. ; def VTPRINT  def echo \27[5i, type \%1, echo \12\27[4i
  181.  
  182. ; Macros for host-initiated file transfer using APC:
  183. ;   NOT NEEDED ANY MORE because of autodownload/autoupload.
  184. ;   Remove the following FORWARD command to reinstate these definitions:
  185.  
  186. :FILES
  187.  
  188. ; Get customization and directory file names.  Environment variables take
  189. ; precedence, so you do not have to edit this file to change these filenames.
  190. ;
  191. if def \$(CKERMOD) assign _myinit \$(CKERMOD)
  192. if not def _myinit assign _myinit \v(home)CKERMOD.INI
  193.  
  194. if remote forward CUSTOM ; Skip all this if -R given on command line
  195.  
  196. if def \$(K_NET_DIRECTORY) assign _netdir \$(K_NET_DIRECTORY)
  197. if not def _netdir assign _netdir \v(home)CKERMIT.KND
  198.  
  199. if def \$(K_DIAL_DIRECTORY) assign _dialdir \$(K_DIAL_DIRECTORY)
  200. if not def _dialdir assign _dialdir \v(home)CKERMIT.KDD
  201.  
  202. CHECK DIAL            ; Is there a DIAL command?
  203. xif fail {             ; No.
  204.     echo DIAL disabled
  205.     forward CUSTOM
  206. }
  207.  
  208. CHECK NETWORK
  209. xif success {
  210.     xif exist \m(_netdir) {
  211.     set net directory \m(_netdir)
  212.     echo { Network directory is \m(_netdir) }
  213.     }
  214. }
  215.  
  216. if eq "\v(name)" "telnet" forward CUSTOM
  217.  
  218. xif exist \m(_dialdir) {
  219.     set dial directory \m(_dialdir)
  220.     echo { Dial directory is \m(_dialdir) }
  221. }
  222.  
  223. COMMENT - Services directory
  224.  
  225. if def \$(K_SERVICE_DIRECTORY) assign _servicedir \$(K_SERVICE_DIRECTORY)
  226. if not def _servicedir assign _servicedir \v(home)CKERMIT.KSD
  227.  
  228. if not exist \m(_servicedir) forward connection
  229. echo { Services directory is \m(_servicedir)}
  230.  
  231. def MAX_SVCS 200               ; Adjust this if you have more entries
  232. define _sd 0                   ; Assume no services directory
  233. open read \m(_servicedir)      ; Try to open services directory file
  234. xif success {
  235.     declare \&d[\m(MAX_SVCS)]  ; It's open, declare directory array
  236.     for \%i 1 \m(MAX_SVCS) 1 { ; Read the lines into the array
  237.     read \&d[\%i]
  238.     if fail break
  239.     }
  240.     close read
  241.     xif > \%i  \m(MAX_SVCS) {
  242.     echo Too many entries in services directory
  243.     echo { Maximum is \m(MAX_SVCS).}
  244.     echo { Change definition of MAX_SVCS in \v(cmdfile) to allow more. }
  245.     echo { Services directory disabled.}
  246.     } else {
  247.         asg \&d[0] \feval(\%i - 1)
  248.         define _sd 1
  249.     }
  250. }
  251.  
  252. xif not \m(_sd) {
  253.     def access echo { Services directory not available.}
  254.     asg list \m(access)
  255. } else {
  256.     def FIND {
  257.     set case off
  258.     for \%i 1 \&d[0] 1 {
  259.         if eq {\%1} {\fsubstr(\&d[\%i],1,\flen(\%1))} break
  260.     }
  261.     if not > \%i \&d[0] return \&d[\%i]
  262.     }
  263.     def LIST {
  264.     xif > \v(argc) 1 {
  265.         find \%1
  266.         if def \v(return) echo \v(return)
  267.         else echo \%1: Not found
  268.     } else {
  269.         echo \&d[0] items in services directory:
  270.         for \%i 1 \&d[0] 1 { echo \fcont(\&d[\%i]) }
  271.     }
  272.     }
  273.     def SPLIT { asg _word1 \%1, asg _word2 \%2 }
  274.     def DOACCESS {               ; (Used internally by ACCESS macro)
  275.     do \%5 \%6 \%7 \%8 \%9   ; Do the connection macro
  276.     if fail end 1
  277.         split \%3                ; Get words from \%3
  278.     asg \%3 \m(_word1)
  279.     asg \%2 \m(_word2)
  280.     do \%3 \%4 {\%1} \%2     ; Login macro, userid, password, prompt
  281.     }
  282.     def ACCESS {
  283.     if not defined \%1 end 1 access what?        ; Check service
  284.     find \%1                                     ; Look it up
  285.     if success doaccess {\%2} \v(return)         ; OK, try it
  286.     else end 1 "\%1" not in services directory   ; Not found
  287.     if fail end 1                                ; DOACCESS failed?
  288.     xif eq \v(cmdlevel) 1 {
  289.         echo
  290.         echo ACCESS: Login succeeded - CONNECTing...
  291.             show escape
  292.             output \13
  293.         connect /quietly
  294.         }
  295.     }
  296. }
  297.  
  298. :CONNECTION ; Macros for making connections
  299.  
  300. COMMENT - SERIAL macro.  Arguments:
  301. ; \%1 = device name
  302. ; \%2 = speed
  303. ;
  304. def SERIAL {
  305.     if < \v(argc) 3                         ; All arguments given?
  306.       end 1 Usage: SERIAL device speed      ; No.
  307.     set line \%1                            ; OK, try to SET LINE.
  308.     if failure -                            ; If this failed,
  309.       end 1 Can't open device: \%1          ; print message and quit.
  310.     set speed \%2                           ; Try to set the speed.
  311.     if fail end 1 Unsupported speed: \%2    ; Failed.
  312.     echo Connection successful.             ; Succeeded.
  313. }
  314.  
  315. COMMENT - NET macro.  Arguments:
  316. ; \%1 = network type
  317. ; \%2 = host name or address
  318. ;
  319. def NET {
  320.     if < \v(argc) 3 end 1 Usage: NET network host
  321.     set network type \%1
  322.     if fail end 1 unsupported network: \%1
  323.     set login user                ; Don't send user ID.
  324.     set host \%2
  325.     if fail end 1 Can't reach host: \%2
  326.     echo Connection successful.
  327. }
  328.  
  329. COMMENT - CALL macro.  Arguments:
  330. ;
  331. ; \%1 = modem type
  332. ; \%2 = device name
  333. ; \%3 = speed
  334. ; \%4 = phone number
  335. ;
  336. def CALL {
  337.     if < \v(argc) 5 -         ; All arguments present?
  338.       end 1 Usage: CALL modem device speed number
  339.     xif not equal {\v(modem)} {\%1} { ; Set modem type
  340.         set modem \%1
  341.         if fail end 1 unknown modem type: \%1
  342.     }
  343.     xif not equal {\v(line)} {\%2} { ; Communication device
  344.         set line \%2
  345.         if fail end 1 can't open device: \%2
  346.     }
  347.     xif not equal {\v(speed)} {\%3} { ; Communication speed
  348.         set speed \%3
  349.         if fail end 1 unsupported speed: \%3
  350.     }
  351.     dial \%4                  ; Dial the number
  352.     if fail end 1 Can't place call: \%4
  353.     end 0 Connection successful.
  354. }
  355.  
  356. COMMENT - TCPCALL macro.  Arguments:
  357. ;
  358. ; \%1 = server name:port
  359. ; \%2 = modem type
  360. ; \%3 = phone number
  361. ;
  362. def TCPCALL {
  363.     if < \v(argc) 4 -         ; All arguments present?
  364.       end 1 Usage: TCPCALL server[:port] modem number
  365.     set net type tcp/ip       ; Which network to use
  366.     if fail end 1 unsupported network: tcp/ip
  367.     set host \%1              ; Access server and port
  368.     if fail end 1 can't access server \%1
  369.     set modem \%2             ; Set modem type
  370.     if fail end 1 unknown modem type: \%2
  371.     dial \%3                  ; Dial the number
  372.     if fail end 1 Can't place call: \%3
  373.     end 0 Connection successful.
  374. }
  375.  
  376. COMMENT - SPRINT macro.  Arguments:
  377. ; \%1 = Service name or address
  378. ;
  379. def SPRINT {
  380.     if < \v(argc) 2 end 1 Usage: \%0 service
  381.     set input timeout proceed
  382.     output @D\13
  383.     input 10 TERMINAL=
  384.     if fail end 1 No terminal prompt
  385.     out D1\13
  386.     inp 10 @
  387.     if fail end 1 No atsign prompt
  388.     output c \%1\13
  389.     input 10 CONNECTED
  390.     if fail end 1 Can't access \%1 from SprintNet
  391. }
  392.  
  393. COMMENT - ULOGIN macro.  For logging into systems where user ID is required
  394. ; but there is no password.  Arguments:
  395. ; \%1 = UNIX user ID
  396. ;
  397. define ULOGIN {
  398.     if < \v(argc) 2 end 1 Usage: \%0 userid
  399.     set input timeout proceed     ; Handle timeouts ourselves
  400.     set case on                   ; Case is important in UNIX
  401.     minput 5 login: Username: {User ID:} {User Name:}
  402.     out \%1\13                    ; Send username, carriage return
  403.     end 0
  404. }
  405.  
  406. COMMENT - VMSLOGIN macro.  Arguments:
  407. ; \%1 = VMS user ID
  408. ; \%2 = Password.  If password not supplied, it is prompted for.
  409. ; \%3 = System prompt.  If omitted a default is supplied.
  410. ;
  411. define VMSLOGIN {
  412.     if < \v(argc) 2 end 1 Usage: \%0 userid [ password [ prompt ] ]
  413.     while not defined \%2 {
  414.         askq \%2 { \%1's password: }
  415.     }
  416.     set parity none               ; Set communication parameters
  417.     set duplex full
  418.     set handshake none
  419.     set input timeout proceed     ; Handle timeouts ourselves
  420.     in 5 Username:                ; Is prompt already there?
  421.     xif fail {                    ; No.
  422.         for \%i 1 3 1 {           ; Try 3 times to get it.
  423.             out \13               ; Send carriage return
  424.             in 5 Username:        ; Look for prompt
  425.             if success break      ; Success, go log in
  426.         }
  427.         if > \%i 3 end 1 No Username prompt
  428.     }
  429.     out \%1\13                    ; Send username, carriage return
  430.     inp 5 Password:               ; Wait 5 sec for this prompt
  431.     if fail end 1 No password prompt
  432.     pause                         ; Wait a sec
  433.     out \%2\13                    ; Send password
  434.     xif not emulation {           ; No emulator built in?
  435.         set input echo off        ; Protect terminal from this
  436.         minput 10 {\27Z} {\27[c} {\27[0c} ; Get terminal ID query
  437.         xif success {                     ; Got one
  438.             output \27[\?1c               ; Send VT100 terminal ID
  439.             in 2 \27[6n                   ; Screen dimension query?
  440.             if succ out \27[\v(rows);\v(cols)R ; Send dimensions
  441.         }
  442.         set input echo on         ; Echo input again
  443.     }
  444.     if not def \%3 -              ; If we were not given a prompt
  445.       asg \%3 {\v(prompt)}        ; use the SET LOGIN PROMPT value
  446.     if not def \%3 -              ; If we still don't have a prompt
  447.       asg \%3 {\13$\32}           ; use this one as the default
  448.     reinp 0 \%3                   ; Did we INPUT the prompt already?
  449.     if fail inp 60 \%3            ; No, look now.
  450.     if fail end 1
  451. }
  452.  
  453. COMMENT - UNIXLOGIN macro.  Arguments:
  454. ; \%1 = UNIX user ID
  455. ; \%2 = Password.  If password not supplied, it is prompted for.
  456. ; \%3 = System prompt.  If omitted a default is supplied.
  457. ;
  458. define UNIXLOGIN {
  459.     local \%m \%i
  460.     if < \v(argc) 2 -
  461.       end 1 Usage: \%0 userid [ password [ prompt ] ]
  462.     while not defined \%2 {
  463.         askq \%2 { \%1's password: }
  464.     }
  465.     set input echo on
  466.     set parity none               ; Set communication parameters.
  467.     set duplex full
  468.     set handshake none
  469.     set input timeout proceed     ; Handle timeouts ourselves
  470.     set case on                   ; Case is important in UNIX
  471.     def \%m 10                    ; Waiting time for INPUT
  472.     for \%i 1 5 1 {
  473.         minput \%m login: {ssword:} {Password for \%1:}
  474.     if success break
  475.     output \B\13
  476.         \%m ::= 6-\%1
  477.     }
  478.     if > \%i 5 end 1 {No response from host}
  479.     xif = \v(minput) 1 {      ; Have username prompt
  480.     output \%1\13          ; Send username
  481.         minput 5 {ssword:} {ssword for \%1:} ; Wait for password prompt
  482.     if fail end 1 {No password prompt}
  483.     }
  484.     pause                         ; Wait a sec
  485.     out \%2\13                    ; Send password
  486.     if not def \%3 -              ; If we were not given a prompt
  487.       asg \%3 {\v(prompt)}        ; use the SET LOGIN PROMPT value
  488.     if not def \%3 -              ; If we still don't have a prompt
  489.       asg \%3 {\10$ }             ; use this one as the default
  490.     reinp 0 \%3                   ; Did we INPUT the prompt already?
  491.     if fail inp 60 \%3            ; No, look now.
  492.     if fail end 1
  493. }
  494.  
  495. COMMENT - VMLINELOGIN macro.  Arguments:
  496. ; \%1 = User ID
  497. ; \%2 = Password
  498. ;
  499. define VMLINELOGIN {
  500.     if < \v(argc) 2 -
  501.       end 1 Usage: \%0 userid [ password ]
  502.     while not defined \%2 {
  503.         askq \%2 { \%1's password: }
  504.     }
  505.     set parity mark               ; Set communication parameters
  506.     set flow none
  507.     set handshake xon
  508.     set duplex half
  509.     set input timeout quit        ; Don't bother with IF FAILURE
  510.     input 10 BREAK KEY            ; Look for BREAK KEY prompt
  511.     pause 1                       ; Wait a second
  512.     output \B                     ; Send BREAK
  513.     input 10 .\17, output logon \%1\13    ; Now log in
  514.     input 10 .\17, output \%2\13          ; Send password
  515.     input 10 .\17, output \13             ; Send carriage return
  516.     input 10 .\17, output \13             ; Send another one
  517.     end 0
  518. }
  519.  
  520. COMMENT - VMFULLOGIN macro.  Arguments:
  521. ; \%1 = User ID
  522. ; \%2 = Password
  523. ;
  524. define VMFULLOGIN {
  525.     if < \v(argc) 2 -
  526.       end 1 Usage: \%0 userid [ password ]
  527.     while not defined \%2 {
  528.         askq \%2 { \%1's password: }
  529.     }
  530.     set input timeout quit      ; Quit if INPUT fails
  531.     set parity even             ; Set communication parameters
  532.     set duplex full
  533.     set handshake none
  534.     set flow xon/xoff
  535.     out \13                     ; Send carriage return
  536.     inp 5 TERMINAL TYPE:        ; Get terminal-type prompt
  537.     out vt-100\13               ; Just send "vt-100"
  538.     inp 20 RUNNING              ; Get RUNNING message
  539.     pau 1                       ; Wait one second
  540.     out \%1\9\%2\13             ; Send user ID, tab, password
  541.     out \13\13                  ; Two more carriage returns
  542.     end 0
  543. }
  544.  
  545. COMMENT - CISLOGIN macro.  Arguments:
  546. ; \%1 = CompuServe User ID
  547. ; \%2 = Password
  548. ; \%3 = Prompt
  549. ;
  550. define CISLOGIN {
  551.     if < \v(argc) 2 -
  552.       end 1 Usage: \%0 userid [ password [ prompt ] ]
  553.     while not defined \%2 {
  554.         askq \%2 { \%1's password: }
  555.     }
  556.     set terminal bytesize 7     ; No 8-bit characters
  557.     set input timeout quit      ; Skip the IF FAILURE's
  558.     output \13                  ; Send initial carriage return
  559.     input 5 Host Name:          ; Look for Host Name prompt
  560.     output cis\13               ; Send "cis" and carriage return
  561.     input 5 User ID:            ; Look for User ID prompt
  562.     output \%1\13               ; Send ID and carriage return
  563.     input Password:             ; Look for Password prompt
  564.     output \%2\13               ; Send password and CR
  565.     if not def \%3 asg \%3 \v(prompt)
  566.     if not def \%3 asg \%3 {CompuServe Information Service}
  567.     input 30 \%3
  568.     end 0
  569. }
  570.  
  571. COMMENT - DOWLOGIN macro.  Arguments:
  572. ; \%1 = Dow Jones Password
  573. ;
  574. define DOWLOGIN {
  575.     while not defined \%1 {              ; Get password
  576.         askq \%1 { Dow Jones password: }
  577.     }
  578.     set input timeout proceed
  579.     input 20 SERVICE PLEASE\?\?\?\?      ; Look for Dow prompt
  580.     if fail end 1 No service prompt
  581.     out djnr\13                          ; Select DJNR
  582.     input 10 @@@@@@@@                        ; Get password prompt
  583.     if fail end 1 No password prompt
  584.     pause 1                              ; Wait a second, then...
  585.     output \%1\13                        ; send password and CR
  586.     input 30 ENTER QUERY                 ; Get DJNR query prompt
  587.     if fail end 1 No main query prompt
  588.     pause 1
  589. }
  590.  
  591. COMMENT - DJNRSPRINT macro: Log in to Dow Jones via SprintNet.
  592. ;
  593. def djnrsprint sprint dow, if success dowlogin
  594.  
  595. COMMENT - NOLOGIN macro.  Does nothing.  Use when login not required.
  596. ;
  597. def nologin comment
  598.  
  599. :CUSTOM ; Customization file
  600.  
  601.  
  602. ; In VMS and OpenVMS, allow for system-wide site customizations
  603.  
  604. xif equal "\v(system)" "VMS" {
  605.     xif exist CKERMIT_INI:CKERMIT.SYS {
  606.     echo Executing CKERMIT_INI:CKERMIT.SYS
  607.     take CKERMIT_INI:CKERMIT.SYS
  608.     }
  609. }
  610.  
  611. ; Execute user's personal customization file
  612.  
  613. xif exist \m(_myinit)  {        ; If it exists,
  614.     echo Executing \m(_myinit)...    ; print message,
  615.     take \m(_myinit)            ; and TAKE the file.
  616. }
  617.  
  618. ; Finish up with traditional greeting.
  619.  
  620. if < \v(ntime) 43200 echo Good Morning!
  621.   else if < \v(ntime) 61200 echo Good Afternoon!
  622.   else echo Good Evening.
  623.  
  624. End ; of C-Kermit 7.0 initialization file.
  625.