Advertisement
andrewharvey

postrgesql84-server.wrapper

Dec 11th, 2011
940
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  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.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement