home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / vsoup128.zip / loginisp.cmd < prev    next >
OS/2 REXX Batch file  |  1997-02-06  |  1KB  |  54 lines

  1. /*
  2.   LoginIsp  -  rg040297
  3.  
  4.   Login to your ISP.  If Option NOWAIT is given, the command will not wait
  5.   until connection has been established.
  6.  
  7.   You have to do the following configuration:
  8.   -  the line '...logoutisp...' must show the effective logoff script
  9.   -  the line 'checkConnection...' must show a connection checker
  10.   -  the line 'dialer...' must contain a command to establish the connection
  11.   -  the line 'pause...' contains a pause command.  If 'slipwait 2' is used in
  12.      'checkConnection', 'pause' can be set to the empty string
  13.   -  'startAfterConnect...' could be defined optionally
  14.   Note:  the value of MyPPP has been generated with PPP-Fake!
  15.  */
  16.  
  17. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  18. call SysLoadFuncs
  19.  
  20. checkConnection   = '@ping www.swol.de 10 1 2>&1 > nul'
  21. pause             = 'rc = SysSleep(2)'
  22. dialer            = '@start /c /min' VALUE('MYPPP',,'os2environment' )
  23. startAfterConnect = '@start /c /min diallog.cmd -interface=ppp0 -leave'
  24.  
  25. TRACE('')
  26.  
  27. option = ARG(1)
  28.  
  29. checkConnection
  30. IF rc = 0 THEN DO
  31.     startAfterConnect
  32.     EXIT
  33. END
  34.  
  35. DO FOREVER
  36.     '@cmd /c logoutisp.cmd'
  37.     '' dialer
  38.     IF option = 'NOWAIT' THEN
  39.     LEAVE
  40.  
  41.     do j = 1 TO 35
  42.     interpret pause
  43.     checkConnection
  44.     if rc = 0 THEN DO
  45.         startAfterConnect
  46.         EXIT
  47.     END
  48.     end j
  49. END
  50.  
  51. startAfterConnect
  52.  
  53. EXIT
  54.