home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 8 / CDACTUAL8.iso / share / os2 / varios / apache / reinit.cmd < prev    next >
Encoding:
Text File  |  1996-02-03  |  1.3 KB  |  56 lines

  1. /* An OS/2 REXX script to terminate the currently running Apache for OS/2. */
  2. /* The one paramter is the location of the HTTPD.PID file as specified by  */
  3. /* the 'PidFile' command in HTTPD.CONF file. If the parameter is not       */     
  4. /* specified it assumes '..\logs\httpd.pid'                                */
  5.  
  6. /* NOTE: This program must be run from the computer currently running      */
  7. /*       Apache for OS/2. It can not be run accros a LAN                   */
  8.  
  9. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  10. call SysLoadFuncs
  11.  
  12. /* Handle paramters or set default. */
  13. if arg() = 1 then 
  14.     if ( (translate(arg(1)) = "HELP") | (left(translate(arg(1)),2) = "-H") | (arg(1) = "?") ) then
  15.         signal USAGE
  16.     else
  17.         pidfile = arg(1)
  18. if arg() > 1 then
  19.     signal USAGE
  20. if ((arg() = 0) | (strip(pidfile) = "")) then
  21.     pidfile = "..\logs\httpd.pid"
  22.  
  23. /* Test for existance of PID file */
  24. result = SysFileTree(pidfile, filefound, "F")
  25. if result>0 then
  26.     signal ERROR
  27. if filefound.0 \= 1 then
  28.     signal NOTFOUND
  29.  
  30. /* Get the PID for the PIDFILE. */
  31. pid = strip(linein(pidfile))
  32.  
  33. /* Reinit Apache. */
  34. '@emxkill 1' pid
  35.  
  36. RETURN
  37.  
  38. USAGE:
  39. SAY
  40. SAY "Usage: REINIT <httpd.pid path>"
  41. SAY
  42. EXIT
  43.  
  44. ERROR:
  45. SAY
  46. SAY "An ERROR has occured."
  47. SAY
  48. EXIT
  49.  
  50. NOTFOUND:
  51. SAY
  52. SAY "PID file '"pidfile"' not found."
  53. SAY
  54. EXIT
  55.  
  56.