home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / msk314.pkz / MSKERMIT.INI < prev    next >
Text File  |  1995-01-18  |  13KB  |  392 lines

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