home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / mskscripts / rolm7171.kds < prev    next >
Text File  |  2020-01-01  |  5KB  |  195 lines

  1. ; 7171.SCR
  2. ;
  3. ; Christine M. Gianone, CUCCA/AcIS, October 1991
  4. ;
  5. ; An MS-DOS Kermit script for easy access to Columbia University's
  6. ; VM/CMS systems and CLIO.  It navigates through ROLMphone and 7171
  7. ; and logs the user in.
  8. ;
  9. ; You can run this script from within Kermit by typing TAKE 7171.SCR,
  10. ; but it is designed for more convenient use by running Batch files
  11. ; from the DOS command line, for example SIMB.BAT:
  12. ;
  13. ;   simb myuserid
  14. ;
  15. ; In this example, userid and password can be given on the DOS command line,
  16. ; for example:
  17. ;
  18. ;   C:\>sima myuserid mypassword
  19. ;
  20. ; The "simb" DOS command requires the following SIMB.BAT file to
  21. ; reside in the user's PATH:
  22. ;
  23. ;   @echo off
  24. ;   kermit def userid %1, def passwd %2, def host sima, take 7171.scr, stay
  25. ;
  26. ; 7171.SCR prompts for CMS ID and password if these are not 
  27. ; already defined, then connects through the CBX, automatically detecting 
  28. ; either a regular DCM phone or a 244PC, logs in.
  29. ;
  30. ; Requires MS-DOS Kermit 3.11 or later.
  31.  
  32. if not < version 311 goto OK
  33. echo Sorry, version 3.11 or later of MS-DOS Kermit is required.
  34. stop
  35.  
  36. :OK
  37.  
  38. ; Macro to issue an error message and stop.
  39. ;
  40. define errstop echo \%1, hangup, stop
  41.  
  42. ; Action starts here
  43. ;
  44. set input case ignore            ; Don't care about alphabetic case.
  45. if eq \m(host) CLIO goto setup        ; No login for CLIO.
  46. if def passwd cls            ; For security...
  47. def \%9                    ; "Thank you" flag.
  48.  
  49. if def host goto ASKUID
  50. :XHOST
  51. ask \%8 {Which CMS system (simb, simc, siml): }
  52. if not def \%8 goto XHOST
  53. assign host \%8
  54. def \%9 Thank you.
  55.  
  56. :ASKUID
  57. if def userid goto askpw
  58.  
  59. :XUID
  60. ask \%8 {Please type your CMS user ID, then press the Enter key: }
  61. if not def \%8 goto XUID
  62. assign userid \%8
  63. def \%9 Thank you.
  64.  
  65. :ASKPW
  66. if def passwd goto thanks
  67. :XPWD
  68. askq \%8 -
  69.   {Please type your password (it won't echo), then press the Enter key: }
  70. if not def \%8 goto XPWD
  71. assign passwd \%8
  72. def \%9 Thank you.
  73.  
  74. :THANKS
  75. def \%8                ; Erase password from memory
  76. if def \%9 echo \%9        ; Be polite
  77. def \%9
  78. echo
  79.  
  80. :SETUP
  81. ;
  82. ; Communication and script settings
  83. ;
  84. take 7171.ini            ; Parameters and key settings.
  85. define getout hangup, exit    ; Define GETOUT macro.
  86. set key \2320 {\Kgetout}    ; Assign GETOUT macro to Alt-Q. 
  87. set terminal type vt320        ; Use VT320 terminal emulation.
  88. set input timeout proceed    ; This enables IF SUCCESS and IF FAILURE.
  89. hangup                ; Hang up any current data connection. 
  90. pause
  91.  
  92. ; Try 3 times to get Rolmphone's attention.
  93. ;
  94. :LOOP
  95. output \13            ; Output a carriage return.
  96. :CBX                ; Assume DCM with CALL, DISPLAY OR MODIFY?
  97. input 6 MODIFY?            ; Look for CBX prompt.
  98. if failure goto RP244PC        ; If not found, go try 244PC.
  99. echo \13CBX dialing...        ; It's the CBX, tell the user.
  100. output CALL \m(host)\13        ; Dial desired 7171.
  101. input 30 COMPLETE        ; Get CALL COMPLETE message
  102. if failure errstop -
  103.   {Sorry, INFO does not answer.  Please try again later.}
  104. goto good            ; Got connected, go login
  105.  
  106. :RP244PC                        ; Let's see if it's a 244PC
  107. output \13AT\13            ; Give the Hayes modem AT command
  108. input 5 OK            ; Look for Hayes OK response.
  109. if failure goto RETRY        ; Not found, try again.
  110. echo 244PC dialing...        ; It's 244PC, tell the user.
  111. output ATDT[\m(host)]\13    ; Make a data call to desired 7171.
  112. input 30 CONNECT                ; Look for modem's confirmation.
  113. if success goto GOOD
  114.  
  115. ; Get here when there is no communication after 3 tries.
  116. ;
  117. echo
  118. echo {  Sorry, I can't seem to communicate with your ROLMphone.}
  119. echo {  Your port is \v(port), your speed is \v(speed).}
  120. echo {  If these parameters are not correct, use Kermit's SET PORT}
  121. echo {  and SET SPEED commands to correct them and try again.}
  122. echo {  Otherwise, please check the data cable between your PC}
  123. echo {  and the ROLMphone and try again.}
  124. echo
  125. hangup
  126. stop
  127.  
  128. :GOOD
  129.  
  130. pause 1                ; Now connect to 7171
  131. set count 3            ; Try 3 times to get its prompt
  132. set input echo off        ; Don't show, too confusing.
  133.  
  134. :TSLOOP
  135. out \13                ; Send CR
  136. inp 3 INAL TYPE:        ; Get prompt    
  137. if succ goto TSOK
  138. if count goto TSLOOP
  139. errstp {Can't get \m(host) prompt}
  140.  
  141. :TSOK
  142. out vt-100\13
  143.  
  144. if eq \m(host) CLIO goto READY        ; No login necessary for CLIO
  145.  
  146. :LOGIN
  147. ;
  148. ; Now log in to VM/CMS
  149. ;
  150. inp 20 RUNNING
  151. if fail errstp {Can't get VM status}
  152. pau 1
  153. out \m(userid)\9
  154. pau 1
  155. out \m(passwd)\13
  156. def passwd
  157. pau 1
  158. out \13\13
  159.  
  160. ; User should be logged in.
  161.  
  162. :READY
  163. echo
  164. echo {  You are now logged in to the IBM mainframe via \m(host).}
  165. echo {  To end your mainframe session, enter the LOGOUT command,}
  166. echo {  then hold down the Alt key and press q to get back to DOS.}
  167. echo {  To return Kermit without ending your mainframe session,}
  168. echo {  hold down the Alt key and press x to get back to DOS.}
  169. echo
  170. echo {  Press any key to start your \m(host) session...}
  171. echo
  172. pause 9999            ; Wait for them to type something.
  173.  
  174. ; Here we go...
  175. ;
  176. set terminal clear        ; Clear terminal screen.
  177. out \12                ; Send a Ctrl-L.
  178. connect                         ; Start terminal emulation.
  179. wait 1 CD
  180. if succ goto WARN
  181. echo
  182. echo {  Your connection to \m(host) is broken.}
  183. echo {  Type EXIT (then Enter) to leave Kermit and go back to DOS.}
  184. stop
  185.  
  186. :WARN
  187. echo
  188. echo Warning: back at PC, but connection to \m(host) might still be active.
  189. echo
  190. echo {  Type CONNECT (then press the Enter key) to go back to \m(host).}
  191. echo {  Type HANGUP (then Enter) to cancel your \m(host) session.}
  192. echo {  Type EXIT (then Enter) to leave Kermit and go back to DOS.}
  193. echo
  194. stop
  195.