home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / rx_slip.zip / chk_loop.cmd next >
OS/2 REXX Batch file  |  1994-10-03  |  1KB  |  34 lines

  1. /*--------------------------------------------------------------*/
  2. /* NOTE: Adjust the following as required by your configuration */
  3. /*--------------------------------------------------------------*/
  4.    PortName      = 'COM2'  /*  Com port to monitor */
  5.    Delay         =  25     /*  Periodic com port check time in seconds */
  6. /*--------------------------------------------------------------*/
  7.  
  8.  
  9. call RxFuncAdd 'RxAsyncLoadFuncs', 'RXASYNC', 'RxAsyncLoadFuncs'
  10. call RxAsyncLoadFuncs
  11.  
  12. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysloadFuncs'        
  13. call SysLoadFuncs                                                
  14.  
  15.    PortHandle    = ''
  16. /* open device */
  17. rc = RxAsyncOpen( PortName, 'PortHandle' )
  18. if rc <> 0   then exit
  19.  
  20. /* Loop version -- doesnt require cron */
  21. Do while (PortHandle <>  '')
  22.    rc=SysSleep(Delay)
  23.    rc = RxAsyncCarrier( PortHandle )
  24.    if rc = 0 then say 'Carrier Detected OK'
  25.       else do
  26.       /*  carrier dropped */
  27.       '@go kill slip'     /* kill slip.exe if it's found */
  28.        rc=SysSleep(5)   
  29.       '@start slip.exe'   /* restart slip.exe if it's found */
  30.       rc=SysSleep(5)   
  31.    end
  32. end  /* end of loop */
  33.  
  34.