home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 5
/
ctrom5b.zip
/
ctrom5b
/
OS2
/
DIVERSEN
/
RX_SLIP
/
CHK_LOOP.CMD
next >
Wrap
OS/2 REXX Batch file
|
1994-10-04
|
1KB
|
34 lines
/*--------------------------------------------------------------*/
/* NOTE: Adjust the following as required by your configuration */
/*--------------------------------------------------------------*/
PortName = 'COM2' /* Com port to monitor */
Delay = 25 /* Periodic com port check time in seconds */
/*--------------------------------------------------------------*/
call RxFuncAdd 'RxAsyncLoadFuncs', 'RXASYNC', 'RxAsyncLoadFuncs'
call RxAsyncLoadFuncs
call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysloadFuncs'
call SysLoadFuncs
PortHandle = ''
/* open device */
rc = RxAsyncOpen( PortName, 'PortHandle' )
if rc <> 0 then exit
/* Loop version -- doesnt require cron */
Do while (PortHandle <> '')
rc=SysSleep(Delay)
rc = RxAsyncCarrier( PortHandle )
if rc = 0 then say 'Carrier Detected OK'
else do
/* carrier dropped */
'@go kill slip' /* kill slip.exe if it's found */
rc=SysSleep(5)
'@start slip.exe' /* restart slip.exe if it's found */
rc=SysSleep(5)
end
end /* end of loop */