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

  1. /* Line 2 */
  2. signal on failure name EXIT
  3. signal on halt name EXIT
  4. signal on syntax name EXIT
  5. Drive    = 'C:' /* Drive with all the goodies*/
  6. Messages = 'C:' /* Drive with Message Bases*/
  7. Log      = 'C:' /* Drive containing logs*/
  8.  
  9. Logpath  = 'log'  /* Path to the logs*/
  10. CmdPath  = 'binl' /* Path to the Command files .cmd*/
  11. MaxPath  = 'max'
  12.  /* Setup 
  13. Queue*/
  14. CntlQueue = 'Cntl'
  15. Drive
  16. 'cd\binl'
  17. 'erase binkley.scd'
  18. 'MODE COM3:38400,n,8,1,to=on,xon=off,dtr=off,idsr=off,odsr=off,octs=on,rts=hs'
  19. Do forever
  20.   'SET TBUF='
  21.   'SET RBUF='
  22.   'SET BTPRIO=F16'
  23.   'c:'
  24.   'cd \'CmdPath
  25.   'btp share'
  26.   errorlevel = RC
  27.   say 'CODE = 'errorlevel
  28.   select
  29.     when errorlevel = 99 then call toss
  30.     when errorlevel = 97 then call toss
  31.     when errorlevel = 95 then call toss
  32.     when errorlevel = 60 then call toss
  33.     when errorlevel = 31 then call prtlog
  34.     when errorlevel = 30 then call toss
  35.     when errorlevel = 20 then call toss
  36.     otherwise NOP
  37.   end
  38. end
  39.  
  40. TOSS:
  41. /* Go toss all incoming mail*/
  42. oq = RXQueue('Set',CntlQueue)
  43. QUEUE 'toss 2'
  44. xx = RXQueue('Set',oq)
  45. return
  46.  
  47. PRTLOG:
  48.   Log
  49.   'cd\'Logpath
  50.   'copy binklex.log bu.log'
  51.   'erase binklex.log'
  52.   'copy cost02.log co2.log'
  53.   'erase cost02.log'
  54.   Drive
  55.   'cd\'MaxPath
  56.   'copy 2 mx2.log'
  57.   'erase 2'
  58. return
  59.  
  60. EXIT:
  61. /* Check that control is running*/
  62. xx = RXQUEUE('Create', CntlQueue)
  63. /* REXX will name queue to another name - otherwise it exists*/
  64. say 'Try to create - 'xx
  65. if xx = CntlQueue then do
  66.   /* Remove it and let control recreate it*/
  67.   xx = RXQUEUE('Delete',CntlQueue)
  68.   Drive
  69.   'cd\'CmdPath
  70.   'start /fs /b control'
  71.   return
  72. end
  73. else
  74.   xx = RXQUEUE('Delete',xx)
  75. /* Let control startup bink1*/
  76. return'exit'
  77.