home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / mskermit / mskermit.ini < prev    next >
Text File  |  2020-01-01  |  14KB  |  407 lines

  1. GOTO GO  ;  FILE MSKERMIT.INI
  2. ;
  3. ; Standard initialization file for MS-DOS Kermit 3.14 and later.  Kermit
  4. ; executes the commands in this file automatically when it starts.  Kermit
  5. ; looks for MSKERMIT.INI first in the current disk and directory, and if it
  6. ; is not found there, then in the disks and directories listed in your DOS
  7. ; PATH variable (if any).  Override Kermit's initialization file search by
  8. ; specifying a different filename on the command line, preceded by the -F
  9. ; switch, for example "kermit -f monday.ini" or "kermit -f nul".
  10. ;
  11. ; Author: Christine M. Gianone, Feb 1990 (for MS-DOS Kermit v3.00).
  12. ; Revisions:
  13. ;   v3.11 Sep 1991
  14. ;   v3.12 Sep 1992
  15. ;   v3.13 Jun 1993
  16. ;   v3.14 Oct 1994
  17. ;
  18. ; CUSTOMIZATIONS
  19. ;
  20. ; It is recommended that you not modify this file.  Instead, you should adapt
  21. ; the sample MSCUSTOM.INI file to make your customizations: key settings,
  22. ; macro definitions, SET commands to override the ones in this file, and so
  23. ; on.  The MSCUSTOM.INI file should go in the same directory as this file.
  24. ; This file will execute MSCUSTOM.INI if it can be found.
  25.  
  26. ; PATCHES
  27. ;
  28. ; The MSKERMIT.PCH file contains "patches" (corrections) to MS-DOS Kermit.
  29. ; If the MSKERMIT.PCH file can be found, and it agrees with your Kermit
  30. ; version, the patches are applied at this time.  The MSKERMIT.PCH file
  31. ; is included on your MS-DOS Kermit distribution diskette.  Updated patch
  32. ; files can be obtained from Columbia University.
  33. ;
  34. :GO
  35. if not < \v(version) 314 forward PATCH
  36. echo This MSKERMIT.INI file may be used only with MS-DOS Kermit 3.14 or later.
  37. stop 1
  38.  
  39. :PATCH
  40. Echo Executing \v(cmdfile)...
  41. if inpath MSR\v(version).PCH forward patch2
  42. if not inpath MSKERMIT.PCH forward begin
  43. :PATCH2
  44. echo Installing patches...
  45. echo
  46. patch
  47.  
  48. :BEGIN
  49. echo MS-DOS Kermit 3.14 Initialization File...
  50.  
  51. COMMENT - Variable definitions...
  52.  
  53. ; Reserved variables.  If you define new macros, don't use these names:
  54. ;
  55. ;  _editor   - DOS command that runs my preferred editor, for EDIT macro.
  56. ;  _editfile - Last EDIT command filename, defined by EDIT macro.
  57. ;  _dialfile - Pathname of dialing directory file, for DIAL macro.
  58. ;  _dialnum  - Last DIAL command phone number, defined by DIAL macro.
  59. ;  _modem    - Modem type for DIAL command.  Used to run the appropriate
  60. ;              dialing script, e.g. HAYES.SCR.
  61. ;  _mdmscr   - Pathname of modem-dialing script file.
  62. ;
  63. ; You can override the default definitions for the above
  64. ; by setting environment variables in your AUTOEXEC.BAT file, for example:
  65. ;
  66. ;   SET EDITOR=EMACS
  67. ;   SET MODEM=DATAPORT
  68. ;   SET MDMSCR=C:\MODEMS\DATAPORT.SCR
  69. ;   SET DIALFILE=C:\PHONES\MSKERMIT.KDD
  70. ;
  71. ; or you can redefine these variables in your MSCUSTOM.INI file.
  72.  
  73. ; Editor...
  74. ;
  75. define _editor edlin            ; EDLIN is the default editor.
  76. if not < \v(dosversion) 500 define _editor edit ; EDIT for DOS 5.00 & later.
  77. ; But the DOS environment variable EDITOR prevails.
  78. if not eq "\$(EDITOR)" "" -
  79.   asg _editor \$(EDITOR)
  80.  
  81. ; FIND command
  82. define _findcmd FIND
  83. if not < \v(dosversion) 500 define _findcmd FIND/I
  84. if not eq "\$(FINDCMD)" "" asg _findcmd \$(FINDCMD)
  85.  
  86. ; Dialing directory file...
  87. ;
  88. asg _dialfile \v(inidir)DIALUPS.TXT    ; Default dialing directory file.
  89. if not eq "\$(DIALFILE)" "" -
  90.   asg _dialfile \$(DIALFILE)
  91. if not exist \m(_dialfile) -
  92.   echo Dialing directory "\m(_dialfile)" not found.
  93.  
  94. ; The type of modem you have.  You also need a corresponding <name>.SCR
  95. ; file to dial the modem.  For example, if the value of _modem is HAYES,
  96. ; you must have a HAYES.SCR file stored in the MODEMS subdirectory of your
  97. ; Kermit directory, or somewhere in your DOS PATH or else in your current
  98. ; directory.
  99. ;
  100. define _modem HAYES            ; Default modem type is HAYES.
  101. if not eq "\$(MODEM)" "" -
  102.   asg _modem \$(MODEM)
  103.  
  104. COMMENT - Macro definitions section...
  105.  
  106. ; Macros for communicating with UNIX, VAX/VMS, and similar systems:
  107. ;
  108. def text set file type text
  109. def binary set fil type binary
  110.  
  111. def _bs check term, if success set key \270 \%1
  112.  
  113. def 8bit set parity none, set term bytesize 8, set term controls 8
  114. def 7bit set term bytesize 7, set term controls 7
  115. def vax set par non, set hand no, set local-echo off, _bs \127
  116. def vms set term type vt320, do vax, do 8bit
  117. def unix do vax, do 7bit
  118. def bbs set term type ansi, do vax, do 8bit
  119.  
  120. ; Macro for communicating with IBM mainframes in linemode:
  121. ;
  122. def ibm set par mark, set flo no, set hand xon, set dup ha, _bs \8
  123.  
  124. ; Macro for communicating with IBM mainframes in fullscreen mode,
  125. ; through 3270 protocol converter like IBM 7171:
  126. ;
  127. def FULLSCREEN set par ev,set flo x,set hand no,set dupl ful, _bs \8
  128.  
  129. ; Additional DOS commands available directly from the MS-Kermit> prompt.
  130.  
  131. ; DOS MORE command... (no "<" needed)
  132. def more if < argc 2 fatal {More what?},-
  133.   run more < \%1
  134.  
  135. ; DOS REN(ame) command...
  136. def rename if < argc 2 fatal {Rename what?},-
  137.   if < argc 3 fatal {Rename \%1 to what?},-
  138.   run ren \%1 \%2
  139.  
  140. ; DOS COPY command...
  141. def copy if < argc 2 fatal {Copy what?},-
  142.   if < argc 3 fatal {Copy \%1 to what?},-
  143.   run copy \%1 \%2
  144.  
  145. ; DOS CHCP command to examine or change code page...
  146. def chcp run chcp \%1
  147.  
  148. ; EDIT command...
  149. def edit if = argc 2 asg _editfile \%1,-
  150.   if not def _editfile fatal {Edit what?},-
  151.   run \m(_editor) \m(_editfile)
  152.  
  153. ; UNIX-like PWD command (show current directory)...
  154. def pwd echo \v(dir)
  155.  
  156. ; CAPTURE command - Easy downloading of a file from the host, with no error
  157. ; checking.  Unlike the LOG SESSION command, CAPTURE always creates a new
  158. ; file.  It overwrites file of same name if it already exists.  Usage: at the
  159. ; MS-Kermit> prompt, type "capture xxx" where xxx is the name of the file you
  160. ; want to create on the PC.  Once you are connected to the host, TYPE the
  161. ; desired file.  Escape back when done.  The captured file will be on your
  162. ; disk (with a TYPE command at the beginning & a prompt at the end).
  163. ;
  164. def CAPTURE if = \v(argc) 1 fatal {Capture into what file?},-
  165.   if exist \%1 del \%1,-
  166.   log session \%1,-
  167.   connect,close session,log sess session.log,close sess
  168.  
  169. ; STATUS macro tells whether previous command succeeded or failed,
  170. ; preserving its return code.
  171. define STATUS asg \%9 \v(status),-
  172.  if = \%9 0 echo SUCCESS,-
  173.  if not = \%9 0 echo FAILURE,-
  174.  end \%9
  175.  
  176. ; Define a FATAL error macro.  Print message, go back to prompt.
  177. def fatal stop 1 \%1
  178.  
  179. ; ERRSTP macro, for use in scripts that want to hang up a dialed
  180. ; or network connection if there is any error.
  181. def errstp echo \%1,hangup,stop 1
  182.  
  183. ; ATHANGUP macro.  Use this if regular HANGUP command doesn't do the trick.
  184. def ATHANGUP sleep 1,out +++,sleep 1,out ath0\13
  185.  
  186. ; LOOKUP macro for use with DIAL command.
  187. ; Uses \m(_dialfile) for the dialing directory filename, defined above.
  188. ; Edit that file to contain the entries you will actually want to use.
  189. ;
  190. def SPLIT assign \%x \%1,-
  191.   assign \%y \%2,-
  192.   assign \%s \%3,-
  193.   assign \%p \%4
  194.  
  195. def LOOKUP if < \v(argc) 2 end 0,-
  196.   if not def _dialfile end 0,-
  197.   if not exist \m(_dialfile) end 0,-
  198.   open read \m(_dialfile),-
  199.   if failure fatal {Can't open dialing directory file \m(_dialfile)},-
  200.   assign \%5 \%x, assi \%6 \%y, assi \%7 \%s, assi \%8 \%p,-
  201.   echo Looking up "\%1",-
  202. :loop,-
  203.   read \%9,-
  204.   if fail forward eof,-
  205.   split \%9,-
  206.   if def \%x if not equal {\%x} {\%1} goto loop,-
  207.   echo From dialing directory: \%x = \%y,-
  208.   assign _dialnum \%y,-
  209.   if def \%s if not eq \%s = set speed \%s,-
  210.   if def \%p if not eq \%p = set parity \%p,-
  211.   forward done,-
  212. :eof,-
  213.   echo "\%1" not found in dialing directory \m(_dialfile),-
  214. :done,-
  215.   assign \%x \%5, assi \%y \%6, assi \%s \%7, assi \%p \%8,-
  216.   close read
  217.  
  218. ; LIST macro to list dialing directory.
  219. ; Assumes pathname of dialing directory is in \m(_dialfile).
  220. define LIST -
  221.   if not def _dialfile fatal {_DIALFILE not defined},-
  222.   if not exist \m(_dialfile) -
  223.     fatal {Can't find dialing directory file \m(_dialfile)},-
  224.   if < argc 2 run more < \m(_dialfile),-
  225.   if > argc 1 run \m(_findcmd) "\%1" \m(_dialfile) | more
  226.  
  227. ; Check that we have a dialing script available for given modem type.
  228. ; This allows _MODEM definition to be changed in MSCUSTOM.INI and even
  229. ; on the fly after initialization.
  230. def CHKMDM -
  231.   asg _mdmscr, -
  232.   if not eq "\$(MDMSCR)" "" -
  233.     asg _mdmscr \$(MDMSCR),-
  234.   if exist \m(_mdmscr) end 0,-
  235.   if exist \v(inidir)MODEMS\\\m(_modem).SCR -
  236.     asg _mdmscr \v(inidir)MODEMS\\\m(_modem).SCR,-
  237.   if not def _mdmscr if inpath \m(_modem).SCR -
  238.     asg _mdmscr \v(inpath)\m(_modem).SCR,-
  239.   if not def _mdmscr end 1,-
  240.   if not exist \m(_mdmscr) end 1,-
  241.   end 0
  242.  
  243. ; DIAL and REDIAL commands...
  244. ;
  245. ; Uses LOOKUP macro to access your dialing directory, if any.
  246. ; If argument omitted, uses previous phone number, if any.
  247. ; If multiple arguments are given, they are concatenated together
  248. ; so you can "dial 800 765 4321".  Saves and restores PARITY and
  249. ; CARRIER settings around dialing.
  250. ;
  251. def DIAL -
  252.   do chkmdm,-
  253.   if fail stop 1 Dialing script not found,-
  254.   if < \v(argc) 2 if not def _dialnum fatal {Dial what?},-
  255.   asg \%1 \%1\%2\%3\%4\%5\%6\%7\%8\%9,-
  256.   if > \v(argc) 1 asg _dialnum \%1,-
  257.   if not < \v(argc) 2 lookup {\m(_dialnum)},-
  258.   asg \%1 \m(_dialnum),-
  259.   asg \%9 \v(carrier),-
  260.   asg \%8 \v(parity),-
  261.   set carrier off,-
  262.   set parity none,-
  263.   take \m(_mdmscr),-
  264.   assign \%7 \v(status),-
  265.   set parity \%8,-
  266.   set carrier \%9,-
  267.   if not = 0 \%7 end 1,-
  268.   if < \v(cmdlevel) 3 ec -
  269. Call complete.  Use the CONNECT command to go online.,-
  270.   end 0
  271.  
  272. define REDIAL if not def _dialnum fatal {No number to redial}, dial
  273. forward XFER
  274.  
  275. :NODIAL
  276. define DIAL -
  277. end 1 DIAL disabled because dialing script for "\m(_modem)" not found.
  278.  
  279. :XFER
  280.  
  281. COMMENT - File transfer settings and macros
  282.  
  283. set file collision rename    ; Don't overwrite existing files
  284. set transfer character-set transparent ; No surprise translations
  285. set receive packet-length 94    ; Regular-size packets
  286. set attributes on        ; Use file-attribute packets
  287. set window 1            ; Don't use sliding windows
  288.  
  289. ; NORMAL, NOISY and CLEAN macros, modify to suit your environment...
  290. def NORMAL set rec pac   94, set ret  5, set block 1, set window 1
  291. def NOISY  set rec pac   40, set ret 20, set block 3, set window 8
  292. def CLEAN  set rec pac 1000, set ret  4, set block 3, set window 4
  293.  
  294. ; FAST and ROBUST macros
  295. ; FAST assumes a clean, well-buffered, effectively-flow-controlled connection.
  296. ; ROBUST assumes nothing.
  297. ; These are oversimplifications - read the documentation.
  298. def FAST ec FAST file transfer settings - use at your own risk...,-
  299.   set win 5, set rec packet 5000, set contr u all,-
  300.   set con p 0 1 3 13 17 19 129 141 145 147
  301. def ROBUST set win 1, set parity space, set rec packet 90, set con p all
  302.  
  303. COMMENT - Script defaults
  304.  
  305. set input timeout proceed    ; Allow IF SUCCESS/FAILURE to work
  306. set input echo on        ; Display port input on screen
  307. set input case ignore        ; Ignore alphabet case for input matching
  308.  
  309. ; The following setups are IBM-PC specific...
  310.  
  311. if not eq "\v(platform)" "IBM-PC" forward CUSTOM
  312.  
  313. COMMENT - Terminal emulation settings.  Modify to suit your environment.
  314.  
  315. check terminal
  316. if fail forward custom
  317.  
  318. set terminal display 7        ; In the 7-bit environment (use 8 for VMS)
  319. set terminal vt320        ; Emulate DEC VT320
  320. set terminal roll off        ; Keep rolled-back screens where they are
  321. set terminal wrap on        ; Tell Kermit to do line wrap
  322. set terminal tabs at 1:8    ; Set tabs at every 8 spaces
  323. set terminal cursor underline    ; Underline cursor (rather than block)
  324. ;
  325. ; The following accounts for the new scan code generated by Space Bar
  326. ; on the LK250 keyboard under MS-DOS Kermit version 3.13 and later.
  327. ;
  328. if eq \v(keyboard) 250 set key \313 \32
  329.  
  330. ; By default, show current directory in prompt
  331. ;
  332. set prompt [\v(dir)] MS-Kermit>
  333.  
  334. COMMENT - Languages
  335.  
  336. if directory \v(inidir)cyrillic -
  337.  def CYRILLIC cfont,-
  338.  if not def \%1 asg \%1 KOI8,-
  339.  take \v(inidir)cyrillic\\\%1.ini,-
  340.  set xfer char cyrillic
  341.  
  342. if directory \v(inidir)hebrew -
  343.  define HEBREW take \v(inidir)hebrew\hebrew.ini
  344.  
  345. ; Undo HEBREW or CYRILLIC
  346. define ROMAN set key clear, set transl inp off, mfont, set xfer char latin1
  347.  
  348. define EASTERN set key clear, set transl inp off, efont, set xfer char latin2
  349.  
  350. ; Commands for changing fonts
  351. ;
  352. if directory \v(inidir)pcfonts forward PCFONTS
  353.  
  354. ; Can't find PCFONTS directory, use IBM code pages (good luck!)...
  355. ;
  356. def _FONT run chcp \%1, set term code cp\%1, set file char cp\%1
  357. forward FONTDEFS
  358.  
  359. :PCFONTS
  360. def _FONT run \v(inidir)pcfonts\loadfont \v(inidir)pcfonts\cp\%1.f16,-
  361.  set term code-page cp\%1,-
  362.  set file char cp\%1
  363. def SCRAWL run \v(inidir)pcfonts\loadfont \v(inidir)pcfonts\scrawl.f16
  364. def CHARSET run \v(inidir)pcfonts\charset
  365.  
  366. :FONTDEFS
  367. def AFONT _font 437 ; Original PC code page
  368. def CFONT _font 866 ; Cyrillic
  369. def EFONT _font 852 ; East 
  370. def HFONT _font 862 ; Hebrew
  371. def IFONT _font 861 ; Icelandic
  372. def MFONT _font 850 ; "Multilingual" = West European Roman
  373.  
  374. :NETS
  375. check networks
  376. if fail forward CUSTOM
  377.  
  378. ; Macro to use Internet host names with Novell's LWP/DOS TELAPI and TSU.
  379. ; Assumes TSU is in the PATH and current directory is writable.
  380. ; Usage: "telapi <host-name>".
  381. ;
  382. def TELAPI run tsu -o \%1 k1,run tsu -a k1 1,set port bios1,connect
  383.  
  384. check tcp
  385. if fail forward CUSTOM
  386.  
  387. ; TELNET macro for making TCP/IP connections using Kermit's built-in TCP/IP.
  388. ; "TELNET <ip-host-name-or-address>" makes a new TCP/IP connection.
  389. ; "TELNET" (by itelf) resumes the current TCP/IP connection.
  390. ;   \%1 = IP host name or address (optional)
  391. ;   \%2 = TCP port (optional)
  392. ;   \%3 = terminal type (optional)
  393. ;
  394. define TELNET -
  395.   set flow none,-
  396.   set port tcp \%1 \%2,-
  397.   pause 0, if fail end 1,-
  398.   if def \%3 set term type \%3,-
  399.   if succ c  
  400.  
  401. COMMENT - Personalized initialization file, if any
  402.  
  403. :CUSTOM
  404. if inpath MSCUSTOM.INI take MSCUSTOM.INI
  405.  
  406. echo Smile!
  407.