home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1999 March B / SCO_CASTOR4RRT.iso / scohelp / root.2 / etc / scohelphttp / scohelphttp~
Text File  |  1998-08-19  |  2KB  |  89 lines

  1. :
  2. #    @(#) scohelphttp 15.5 98/03/03 
  3. #
  4. #       This script is used to control scohelphttp
  5. #
  6. #       usage:  scohelphttp [start|stop|enable|disable|query|restart|rotate]
  7. #
  8. #           start
  9. #               Starts scohelphttp. 
  10. #           stop
  11. #               Stops scohelphttp.  
  12. #           enable
  13. #        Enables automatic startup of scohelphttp at boot up.
  14. #           disable
  15. #               Disables automatic startup of scohelphttp at boot up.
  16. #           query
  17. #               query current state of scohelphttp
  18. #        restart
  19. #        rereads config files without stopping server
  20. #        rotate
  21. #        archives log files and zero's current logs
  22. #
  23. #
  24.  
  25. [ -f /usr/lib/scohelp/.utils ] && . /usr/lib/scohelp/.utils
  26.  
  27. # Usage message
  28. usage () {
  29.     echo "usage: scohelphttp [start|stop|restart|enable|disable|query|rotate]"
  30. }
  31. # check for netscape
  32.  
  33. if [ -n "${SERVER_BIN}" ] && [ ! -x "${SERVER_BIN}" ]
  34. then
  35.     echo "No Netscape server is installed for use by SCOHelp. Please install\n\
  36. a Netscape server to enable SCOHelp.\n" >&2
  37.     exit 1
  38. fi
  39.  
  40. #
  41. # Main
  42. #
  43. case $1 in
  44.     start)
  45.         [ -x $SERVER_DIR/start ] &&
  46.             ( cd $SERVER_DIR
  47.           /bin/su root -c ./start
  48.         )
  49.         ;;
  50.     stop)
  51.         [ -x $SERVER_DIR/stop ] &&
  52.             ( cd $SERVER_DIR
  53.           /bin/su root -c ./stop
  54.         )
  55.         ;;
  56.     enable)
  57.         [ -x $SERVER_DIR/enable ] &&
  58.             ( cd $SERVER_DIR
  59.           /bin/su root -c ./enable
  60.         )
  61.         ;;
  62.     disable)
  63.         [ -x $SERVER_DIR/disable ] &&
  64.             ( cd $SERVER_DIR
  65.           /bin/su root -c ./disable
  66.         )
  67.         ;;
  68.     query)
  69.         [ -x $SERVER_DIR/query ] &&
  70.             ( cd $SERVER_DIR
  71.           ./query
  72.         )
  73.         ;;
  74.     rotate)
  75.         [ -x $SERVER_DIR/rotate ] &&
  76.         ( cd $SERVER_DIR
  77.          /bin/su root -c ./rotate )
  78.         ;;
  79.     restart)
  80.         [ -x $SERVER_DIR/restart ] &&
  81.         ( cd $SERVER_DIR
  82.          /bin/su root -c "./restart")
  83.         ;;
  84.     *)
  85.         usage
  86.         ;;
  87. esac
  88.  
  89.