home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / slip-cm.zip / CMWrapper.CMD < prev    next >
OS/2 REXX Batch file  |  1994-03-30  |  2KB  |  54 lines

  1. /******************************************************************/
  2. /* CMWRAPPER                                                      */
  3. /*                                                                */
  4. /*    This is a skeleton for a CMANAGER demand-dial wrapper.      */
  5. /*    TCP/IP functions must be enclosed in a wrapper to use the   */
  6. /*    demand-dial capabilities provided by CMANAGER.              */
  7. /*                                                                */
  8. /*    This routine can be altered at will as long as the          */
  9. /*    following conventions are observed:                         */
  10. /*                                                                */
  11. /*    1. CMSTART() must be called before the TCP/IP application   */
  12. /*       is invoked.  It is advisable to use the blocking form of */
  13. /*       CMSTART(id, 1) unless you want to perform your own       */
  14. /*       SLIPWAIT.                                                */
  15. /*                                                                */
  16. /*    2. CMSTOP() must be called whenever the wrapper is          */
  17. /*       terminated, either normally, by CTRL-C, or by kill       */
  18. /*       signal.  Therefore, the SIGNAL ON exits should be        */
  19. /*       preserved and all execution paths should lead to a       */
  20. /*       CMSTOP() call.                                           */
  21. /*                                                                */
  22. /*    3. Select a different unique id (i.e., CMSTART(id, 1)) for  */
  23. /*       each wrapper, but use the same id within a wrapper.      */
  24. /*       While these ids do not affect CMANAGER, they are helpful */
  25. /*       for debugging and logging purposes.                      */
  26. /******************************************************************/
  27.  
  28. trace OFF
  29.  
  30.   /*** These signal traps should be preserved ***/
  31.  
  32.   signal on HALT name CLEANUP
  33.   signal on FAILURE name CLEANUP
  34.   signal on SYNTAX name CLEANUP
  35.  
  36.   /*** Replace [ID] with the unique id for this wrapper ***/
  37.  
  38.   unique = [ID]
  39.  
  40.   parse arg parameters
  41.  
  42.   if \CMStart(unique, 1) then 
  43.     say date(USA) time() "001S connection could not be started"
  44.   else do
  45.     /*** include any code necessary to invoke the application ***/   
  46.     /*** here.  The 'parameters' variable will contain any    ***/
  47.     /*** command-line parameters passed to the wrapper        ***/
  48.   end /* else */
  49.  
  50. CLEANUP: 
  51.  
  52.   call CMStop unqiue
  53.  
  54. return (RC)