home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 35 Internet
/
35-Internet.zip
/
rx_slip.zip
/
chk_loop.cmd
next >
Wrap
OS/2 REXX Batch file
|
1994-10-03
|
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 */