Want more features on Pastebin? Sign Up, it's FREE!
Guest

postrgesql84-server.wrapper

By: andrewharvey on Dec 11th, 2011  |  syntax: None  |  size: 0.71 KB  |  views: 120  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/sh
  2. #
  3. # MacPorts generated daemondo support script
  4. #
  5.  
  6. #
  7. # Init
  8. #
  9. prefix=/opt/local
  10. PGCTL=/opt/local/lib/postgresql84/bin/pg_ctl
  11.  
  12. #
  13. # Start
  14. #
  15. Start()
  16. {
  17.         su postgres -c "${PGCTL} -D ${POSTGRESQL84DATA:=/opt/local/var/db/postgresql84/defaultdb} start -l /opt/local/var/log/postgresql84/postgres.log"
  18. }
  19.  
  20. #
  21. # Stop
  22. #
  23. Stop()
  24. {
  25.         su postgres -c "${PGCTL} -D ${POSTGRESQL84DATA:=/opt/local/var/db/postgresql84/defaultdb} stop -s -m fast"
  26. }
  27.  
  28. #
  29. # Restart
  30. #
  31. Restart()
  32. {
  33.         Stop
  34.         Start
  35. }
  36.  
  37. #
  38. # Run
  39. #
  40. Run()
  41. {
  42. case $1 in
  43.   start  ) Start   ;;
  44.   stop   ) Stop    ;;
  45.   restart) Restart ;;
  46.   *      ) echo "$0: unknown argument: $1";;
  47. esac
  48. }
  49.  
  50. #
  51. # Run a phase based on the selector
  52. #
  53. Run $1
  54.  
  55.  
clone this paste RAW Paste Data