home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / mskermit / msilog.scr < prev    next >
Internet Message Format  |  2020-01-01  |  3KB

  1. Date: Fri, 17 Feb 89 16:05:58 +0100
  2. From: (anonynmous)
  3. Subject: An MS-Kermit logging package
  4.  
  5.      While using MSKermit scripts (with pleasure) I discovered that some
  6. tricks can provide a logging package with a structure some might like. I
  7. include a skeleton of my development below for your database, if you like.
  8. But I'd prefer it From: Anonymous.
  9.  
  10.      In the course of writing a rather general logging package with MSKermit
  11. for our users, I tried to confine all the parameters he has to modify in a
  12. single file and to limit the number of files to the minimum, while still
  13. preserving modularity. I came to a solution that, at the expense of a
  14. naughty trick, can gather both DOS and Kermit user-controllable parameters
  15. and even code. According to the presence/absence of the parameters, the
  16. package makes its way through all the paths they relate to. At the end,
  17. there is provision for anything the user wishes, be it CONNECT or RUN
  18. his-process with retry.
  19.  
  20.      The final general syntax is CALLHOST [LOG] (the CONLOG file being for
  21. problem support). Shorter files are distributed for the most common paths.
  22. Remember one has to double %'s in DOS batch files when they are not intended
  23. for parameters or variables.
  24.  
  25. The abridged CALLHOST.BAT file goes:
  26.  
  27. @ECHO OFF
  28. GOTO %%DOS
  29. :%%DOS ; Kermit parameters, really. Update them with your own.
  30. define \%B 19200                ; Baud rate
  31. define \%R 3                    ; Global retry count
  32. define \%N ATDPW0WT562900       ; Hayes dialing command if modem
  33. ... and several other such path parameters ...
  34. Note: we could have any Kermit code, even:
  35. if defined \%? goto PART_2 ; for multiple threads.
  36. define \%U VM-userid            ; if Logon wanted
  37. define \%P password             ; optional, or may be "@CON"
  38. define \%X CONNECT              ; Kermit command to execute if success
  39. comment define \%Y your-job     ; DOS procedure to \%X=RUN if success
  40. comment define \%Z its-parms    ; its parameters
  41. pop ; End of Kermit parameters
  42. :%DOS
  43. ECHO OFF
  44. KERMIT -F CALLHOST.KER, PROCESS %0.BAT %1 >CON%1
  45. IF NOT ERRORLEVEL 1 REM any more DOS
  46.  
  47. And the abridged CALLHOST.KER goes:
  48.  
  49. if not defined PROCESS define PROCESS take CALLHOST.KER ; 1st time in
  50. if not defined \%1 pop ; 1st time done
  51.  
  52. if defined \%2 set take-echo on ; logging file present
  53.  
  54. define @ECHO comment nooped DOS command
  55. take \%1        ; parameters file
  56. define @ECHO
  57.  
  58. if not defined \%C define \%C 1
  59. if not defined \%B define \%B 1200
  60. if not defined \%R define \%R 1
  61. set port  COM\%C
  62. set speed \%B
  63. etc...
  64.  
  65. set count \%R
  66. goto AGAIN
  67. :RETRY
  68.    if not count goto DONE
  69.    echo Reprise g)n)rale\13
  70. :AGAIN
  71.    set errorlevel 0
  72.    set handshake none
  73.    set flow-control none
  74.    set local-echo off
  75.  
  76.    if defined \%N take callrtt.ker      ; phone call
  77.    if errorlevel 1 goto RETRY
  78.  
  79. and one such for each path ...
  80.  
  81.    if defined \%U take callvm.ker       ; VM logon
  82.    if errorlevel 1 goto RETRY
  83.  
  84.    if defined \%X \%X \%Y \%Z           ; possible user process
  85.    if errorlevel 1 goto RETRY
  86.  
  87. :DONE
  88.  
  89.