home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / lorautil.zip / CRONTEST.CMD < prev    next >
OS/2 REXX Batch file  |  1995-05-08  |  2KB  |  59 lines

  1. /* CRONtest.cmd - test if CRON (and Lora) are running; if not, execute them.
  2. Version 1.01 by Elliott Goodman, 23 April, 1994
  3. Uses RxExtras.DLL (RXX19.ZIP 156846 021994) available here, 1:102/1319 
  4.  
  5. Donations for this program may be sent to:
  6.  
  7.      Elliott Goodman        
  8.      PO Box 500038          
  9.      Palmdale, CA 93591-0038
  10. */
  11.  
  12. call RxFuncAdd 'RxExtra', 'RxExtras', 'RxExtra'
  13. call RxExtra "Load"
  14.  
  15. temp. = NUL
  16. Flag1 = 0            /* clear variables before use */
  17. Flag2 = 0
  18.  
  19. /* create a tracking file */                
  20. report = 'd:\lora\1CRON.TXT'
  21.                                             
  22. Call RxQuerySwitchList "temp."
  23. Do i = 1 to temp.0
  24.    if temp.i = 'CRON' then    /* Cron running, set flag */
  25.     Flag1 = 1
  26.    if temp.i = 'Lora' then    /* Lora running, set flag */
  27.     Flag2 = 1
  28. End /* do */
  29.  
  30. if Flag1 = 0 then
  31.   do
  32.     'start "CRON" /c /b /min e:\util\cronrgf.cmd e:\util\cronfile'
  33.         m_txt = 'Crontest: CRON resurrected'
  34.         call lineout report, m_txt
  35.         m_txt = date('U')
  36.         call lineout report, m_txt
  37.         m_txt = time('C')
  38.         call lineout report, m_txt
  39.         m_txt = ''
  40.         call lineout report, m_txt
  41.   end
  42.  
  43. if Flag2 = 0 then    /* flag not set, Lora not running, start it */
  44.   do
  45.     'd:'
  46.     'cd \LORA'
  47.     'start "Lora" /c d:\lora\lora.exe'
  48.         m_txt = 'Crontest: Lora resurrected'
  49.         call lineout report, m_txt
  50.         m_txt = date('U')
  51.         call lineout report, m_txt
  52.         m_txt = time('C')
  53.         call lineout report, m_txt
  54.         m_txt = ''
  55.         call lineout report, m_txt
  56.   end
  57.  
  58. Call RxExtra "Drop"        /* clean up */
  59.