home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / control.zip / bink1.cmd next >
OS/2 REXX Batch file  |  1993-11-26  |  3KB  |  140 lines

  1. /* Line 1*/
  2. /* Author Dave Sloan - July 1993*/
  3. /* Written to completely control inbound and outbound files and mail*/
  4. /* Need Control.cmd in same path*/
  5. /* This program starts Control.cmd*/
  6. /* Control.cmd checks that Bink1.cmd is running and we check for Control.cmd*/
  7. 'echo on'
  8. signal on failure name EXIT
  9. signal on halt name EXIT
  10. signal on syntax name EXIT
  11. Drive    = 'C:' /* Drive with all the goodies*/
  12. Messages = 'C:' /* Drive with Message Bases*/
  13. Log      = 'C:' /* Drive containing logs*/
  14.  
  15. Logpath  = 'log'  /* Path to the logs*/
  16. CmdPath  = 'bink' /* Path to the Command files .cmd*/
  17. MaxPath  = 'max'
  18.  
  19.  /* Setup 
  20. Queue*/
  21. CntlQueue = 'Cntl'
  22. Drive
  23. 'cd\'CmdPath
  24. 'erase binkley.scd'
  25. 'MODE COM1:38400,n,8,1,to=on,xon=off,dtr=off,idsr=off,odsr=off,octs=on,rts=hs'
  26. Do Forever
  27.   'SET TBUF='
  28.   'SET RBUF='
  29.   'SET BTPRIO=F16'
  30.   Drive
  31.   'cd \'CmdPath
  32. /* Start Binkley Mailer*/
  33.   'btp share'
  34.   errorlevel = RC
  35.   select
  36. /* Toss Mail to message bases and make packets for other nodes*/
  37.     when errorlevel = 99 then call toss
  38.     when errorlevel = 97 then call toss
  39.     when errorlevel = 95 then call toss
  40.     when errorlevel = 60 then call toss
  41. /* Pickup IBM Mail 40:6496/0*/
  42.     when errorlevel = 44 then call IBMNET
  43. /* Pickup RBBS Admin 8:990/1*/
  44.     when errorlevel = 43 then call RBBS1
  45. /* Get Mail from 8:916/1*/
  46.     when errorlevel = 42 then call RBBS
  47. /* Get IMEX echos*/
  48.     when errorlevel = 41 then call Richard
  49. /* Create latest and greatest nodelst*/
  50.     when errorlevel = 32 then call nodelst
  51. /*Nightly Cleanup*/
  52.     when errorlevel = 31 then call DAILY
  53.     when errorlevel = 30 then call toss
  54. /* Mail to process*/
  55.     when errorlevel = 20 then call toss
  56. /* Tics to process*/
  57.     when errorlevel = 10 then call toss
  58. /* Weekly Statistics Report*/
  59.     when errorlevel =  7 then call stats
  60.     otherwise NOP
  61.   end
  62. end
  63. exit
  64.  
  65.  
  66. TOSS:
  67. /* Go toss all incoming mail*/
  68. oq = RXQueue("Set",CntlQueue)
  69. QUEUE 'toss 1'
  70. xx = RXQueue("Set",oq)
  71. return
  72.  
  73. DAILY:
  74.  
  75. /* Go do daily processing*/
  76. oq = RXQueue('Set',CntlQueue)
  77. QUEUE 'daily 1'
  78. xx = RXQueue("Set",oq)
  79. /* Keep the old logs one day*/
  80. Log
  81. 'cd\'Logpath
  82. 'copy binkley.log bt.log'
  83. 'erase binkley.log'
  84. 'copy cost01.log co1.log'
  85. 'erase cost01.log'
  86. Drive
  87. /* Update the schedule*/
  88. /* recycle user log*/
  89. 'cd\'MaxPath
  90. 'copy 1 mx1.log'
  91. 'erase 1'
  92. Return
  93.  
  94. RICHARD:
  95. oq = RXQueue("Set",CntlQueue)
  96. QUEUE 'node 89:85/5 1'
  97. xx = RXQueue("Set",oq)
  98. return
  99.  
  100. RBBS:
  101. oq = RXQueue("Set",CntlQueue)
  102. QUEUE 'node 8:916/1 1'
  103. xx = RXQueue("Set",oq)
  104. return
  105.  
  106. RBBS1:
  107. oq = RXQueue("Set",CntlQueue)
  108. QUEUE 'node 8:990/1 1'
  109. xx = RXQueue("Set",oq)
  110. return
  111.  
  112. IBMNET:
  113. oq = RXQueue("Set",CntlQueue)
  114. QUEUE 'node 40:6496/0 1'
  115. xx = RXQueue("Set",oq)
  116. return
  117.  
  118. STATS:
  119. oq = RXQueue("Set",CntlQueue)
  120. QUEUE 'stats 1'
  121. xx = RXQueue("Set",oq)
  122. return
  123.  
  124. EXIT:
  125. /* Check that control is running*/
  126. xx = RXQUEUE('Create', CntlQueue)
  127. /* REXX will name queue to another name - otherwise it exists*/
  128. say 'Try to create - 'xx
  129. if xx = CntlQueue then do
  130.   /* Remove it and let control recreate it*/
  131.   xx = RXQUEUE("Delete",CntlQueue)
  132.   Drive
  133.   'cd\'CmdPath
  134.   'start /fs /b control'
  135.   return
  136. end
  137. else
  138.   xx = RXQUEUE("Delete",xx)
  139. /* Let control startup bink1*/
  140. return