home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / m2vbbs15.zip / M2DOWN.CMD < prev    next >
OS/2 REXX Batch file  |  1993-08-14  |  5KB  |  155 lines

  1. /***************************************************************************
  2.   Rexx VBBS/2-M2Zmodem Interface Written by Cunnus ShaktI @1509509 Vnet.
  3.   Call The Premier OS/2 Support BBS - Moonflower/2 at 509-891-6148.
  4.   To Install this file, Change the 'Filein =', 'Fileout =', cdlist, temppath,
  5.   & 'batchlist =' variables to reflect your main vbbs directory. Do not
  6.   change the filenames, just The paths. If you do not want the cd &
  7.   lan copy to local capabiliy, then you must remove all characthers
  8.   between the quotes for the cdlist & temppath parameters Then place
  9.   this file in your main VBBS directory along With a copy of M2ZModem
  10.   version 2.13 (this is the only version known to work correctly with
  11.   this rexx routine.) transfer protocol & the M2zmodem.msg file. The
  12.   Command lines in vconfig should be as follows:
  13.  
  14.   Download: M2down.CMD %8 -ZS %3
  15.  
  16.   These comments must remain in this position in this file in order
  17.   for this Rexx file to work correctly.
  18. ****************************************************************************/
  19. arg node mode vpath
  20. /*********************Begin user configuration section*********************/
  21. cdlist = "F:G:H:I:J:K:L:"
  22. temppath = "c:\VBBS\hold"
  23. filein = "c:\vbbs\mz"node".log"
  24. fileout = "c:\vbbs\dsz"node".log"
  25. batchlist = "c:\vbbs\batch"node".lst"
  26. /*********************End user configuration section***********************/
  27. call RxFuncAdd 'SysFileDelete' , 'RexxUtil' , 'SysFileDelete'
  28. call SysFileDelete(fileout)
  29. call SysFIleDelete(filein)
  30. tempath = temppath''node
  31. parse upper var cdlist cdlista ':' cdlistb ':' cdlistc ':' cdlistd ':' cdliste ':' cdlistf ':' cdlistg ':' cdlisth ':'
  32. isbatch = substr(vpath,1,1)
  33. if isbatch = '@' then call batch
  34.      select
  35. when isbatch = cdlista then call cdcopysingle
  36. when isbatch = cdlistb then call cdcopysingle
  37. when isbatch = cdlistc then call cdcopysingle
  38. when isbatch = cdlistd then call cdcopysingle
  39. when isbatch = cdliste then call cdcopysingle
  40. when isbatch = cdlistf then call cdcopysingle
  41. when isbatch = cdlistg then call cdcopysingle
  42. when isbatch = cdlisth then call cdcopysingle
  43. otherwise nop
  44.      End
  45. if isbatch <> "@" then call single
  46. if over = 'bye' then do
  47. call lineout fileout
  48. call lineout filein
  49. call SysFileDelete(filein)
  50. call SysFileDelete(delpath)
  51. 'echo y|del' tempath'\*.*'
  52. exit
  53. end
  54. exit
  55. call lineout fileout
  56. call lineout filein
  57. call SysFileDelete(filein)
  58. exit
  59.  
  60. single:
  61. 'm2zmodem.exe -f 1 -h -o mz'node'.log -n -s 'vpath
  62. call linein filein
  63. lineb = linein(filein)
  64. parse var lineb "=>" filepath
  65. linec = linein(filein)
  66. parse var linec "=>" bc
  67. parse var bc "=" cpsa
  68. parse var cpsa cpsb "."
  69. parse var cpsa "=" bytesa
  70. bytes = right(bytesa,7)
  71. cps = right(cpsb,5)
  72. call lineout filein
  73. call SysFileDelete(filein)
  74. call LINEOUT fileout,'z'bytes' 19200 bps'cps' cps   0 errors     0 1024'filepath' 0'
  75. return
  76.  
  77. batch:
  78. call cdbatch
  79.    do until vpath = " "
  80. if (lines(batchlist)=0) then leave
  81. vpath = linein(batchlist)
  82. if vpath = " " Then dlline = 'm2zmodem.exe -f 1 -h -n -s nofile'
  83.                else dlline = 'm2zmodem.exe -f 1 -h -o mz'node'.log -n -c -s 'vpath
  84. dlline
  85. call linein filein
  86. lineb = linein(filein)
  87. parse var lineb "=>" filepath
  88. linec = linein(filein)
  89. parse var linec "=>" bc
  90. parse var bc "=" cpsa
  91. parse var cpsa cpsb "."
  92. parse var cpsa "=" bytesa
  93. bytes = right(bytesa,7)
  94. cps = right(cpsb,5)
  95. call LINEOUT fileout,'z'bytes' 19200 bps'cps' cps   0 errors     0 1024'filepath' 0'
  96. call lineout filein
  97. call SysFileDelete(filein)
  98.    end
  99. dlline = 'm2zmodem.exe -f 1 -h -n -s nofile'
  100. dlline
  101. over = 'bye'
  102. return
  103.  
  104. cdcopysingle:
  105. numpos = lastpos('\',vpath)
  106. numposa = numpos + 1
  107. cdfile = substr(vpath,numposa)
  108. 'copy' vpath tempath
  109. vpath = tempath'\'cdfile
  110. 'attrib -r' vpath
  111. delpath = vpath
  112. over = 'bye'
  113. return
  114.  
  115. cdbatch:
  116.   do until batchpath = ' '
  117. batchpath = linein(batchlist)
  118. parse upper var batchpath iscda ':'
  119. parse upper var batchlist batchlista '.'
  120. batchlistb = batchlista'.bbb'
  121.  
  122.      select
  123. when iscda = cdlista then call cdbatchwrite
  124. when iscda = cdlistb then call cdbatchwrite
  125. when iscda = cdlistc then call cdbatchwrite
  126. when iscda = cdlistd then call cdbatchwrite
  127. when iscda = cdliste then call cdbatchwrite
  128. when iscda = cdlistf then call cdbatchwrite
  129. when iscda = cdlistg then call cdbatchwrite
  130. when iscda = cdlisth then call cdbatchwrite
  131. otherwise call regbatchwrite
  132.       end
  133. if (lines(batchlist)=0) then leave
  134.   end
  135. call lineout batchlistb
  136. call lineout batchlist
  137. call SysFileDelete(batchlist)
  138. 'copy' batchlistb batchlist
  139. call SysFileDelete(batchlistb)
  140. return
  141.  
  142. cdbatchwrite:
  143. numpos = lastpos('\',batchpath)
  144. numposa = numpos + 1
  145. cdfile = substr(batchpath,numposa)
  146. 'copy' batchpath tempath
  147. batchpatha = tempath'\'cdfile
  148. 'attrib -r' batchpatha
  149. call lineout batchlistb,batchpatha
  150. return
  151.  
  152. regbatchwrite:
  153. call lineout batchlistb,batchpath
  154. return
  155.