home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / autoppp.zip / README < prev    next >
Text File  |  1996-10-20  |  5KB  |  99 lines

  1. AutoPPP -   A REXX script that periodically connects to your ISP using 
  2.             PPP.EXE and SLATTACH.EXE and executes a program once the 
  3.             connection is established.
  4.  
  5. Author:     David Forrai <dforrai@erinet.com>
  6.  
  7. DISCLAIMER:  Please note that this software is freeware.  You are free
  8. to distribute and/or modify it.  The author does not warrant that this
  9. software will meet your requirements or that the operation of the
  10. software will be error free.  The author will not be liable for any loss
  11. or damages occurred by the use of this software.
  12.  
  13. File list:
  14.  
  15.    README         - This file
  16.    AutoPPP.CMD    - The main REXX program that launches PPP.EXE
  17.    Wait4PPP.CMD   - A background REXX program that monitors SLATTACH 
  18.                     output and launches the specified program when the 
  19.                     connection is established.
  20.  
  21. Description:
  22.  
  23. AutoPPP will dial you ISP using PPP and SLATTACH.  You must set the PPP 
  24. parameters using the PPP.CFG file in the TCPIP\ETC directory.  If you 
  25. launch AutoPPP without any command line parameters, AutoPPP will start 
  26. PPP.EXE and connect to your ISP.  If PPP.EXE terminates, AutoPPP will 
  27. restart PPP.EXE.  In this mode you must manually kill the script, 
  28. otherwise it will try to keep your PPP connection established 
  29. indefinitely.  The syntax for this mode of operation is:
  30.  
  31. AutoPPP
  32.  
  33. There are three optional command line parameters.  These parameters 
  34. allow periodic execution of an application after the PPP connection is 
  35. established.  As long as that application is running, AutoPPP will try 
  36. to keep your PPP connection up by restarting PPP.EXE after it 
  37. terminates.  Once the application terminates, AutoPPP will wait until 
  38. the default or specified period from the start of the connection process
  39. before connecting and launching the application again.  By default, the
  40. start time for the PPP connection is immediately and the interval is 24 
  41. hours.  The syntax for this mode of operation is:
  42.  
  43. AutoPPP myapp.exe myapps_parameters
  44.  
  45. If you specify the path of myapp.exe, the default directory will be 
  46. changed to this path before launching myapp.exe.  myapp could also be a 
  47. OS/2 command file, eg. myapp.cmd
  48.  
  49. If you wish to start the PPP connection at a specific time and restart 
  50. at 24 hour intervals, use the following syntax:
  51.  
  52. AutoPPP /Hxx:yy myapp myapp_parameters
  53.  
  54. The /H switch MUST be before myapp and the start time must be specified 
  55. in 24 hour format (eg. 0:00 = midnight, 12:00 = noon, 23:00 = 11pm) 
  56. where xx is in hours between 0 and 23 and yy is in minutes between 0 and
  57. 59.
  58.  
  59. To change the interval between launches, use the syntax:
  60.  
  61. AutoPPP /Ixx:yy myapp myapp_parameters
  62.  
  63. The /I switch MUST be specified before myapp.  It can be used in 
  64. conjunction with the /H switch.  The order of /I and /H doesn't matter 
  65. as long as they both precede the application.  Again, xx is in hours 
  66. (between 0 and 23) and yy in minutes (between 0 and 59).
  67.  
  68. How it works
  69.  
  70. The script parses the command line and sets parameters accordingly.  If 
  71. a start hour is specified, AutoPPP will calculate how long to wait 
  72. before this time occurs from the current time, then sleep for that 
  73. period.  When AutoPPP wakes up (if it was put to sleep by the /H 
  74. switch), it creates a REXX queue, starts a minimized background process 
  75. (Wait4PPP) that monitors this queue, then starts PPP.EXE piping its 
  76. output into the queue.  PPP.EXE is a PM app, therefore no output from 
  77. PPP.EXE is piped into the queue.  Fortunately, SLATTACH.EXE is a VIO 
  78. app, so its output gets placed on the queue.  When Wait4PPP reads that 
  79. the connection has been established out of the queue, it writes a 
  80. message to the queue that the application is launched.  It then launches
  81. the application and sleeps until the application terminates.  When the 
  82. application terminates, it writes a message to the queue stating that 
  83. the application has terminated.  After PPP.EXE terminates, control is 
  84. passed back to AutoPPP.  It reads the queue.  If it finds that the 
  85. application was never launched, it sends a message to the queue to tell 
  86. Wait4PPP to terminate.  It then loops back to re-establish the 
  87. connection and attempt to launch the program again.  If the application 
  88. was started but no message indicates it ended, AutoPPP will attempt to 
  89. re-establish the PPP connection without trying to launch the 
  90. application.  Finally, if PPP.EXE terminates and the application has 
  91. started and ended, PPP calculates the total connect time (including 
  92. possible reconnects), subtracts this from the interval, then sleeps for 
  93. that period of time.  When it wakes up, it repeats the process.
  94.  
  95. AutoPPP is useful for those who want to download e-mail messages or news
  96. articles automatically (such as when they're sleeping!) such that they 
  97. can read them at there leisure.  I hope you find AutoPPP useful.  Please
  98. send bug reports to David Forrai <dforrai@erinet.com>.
  99.