Created
March 3, 2013 20:00
-
-
Save csaura/5078004 to your computer and use it in GitHub Desktop.
postgres.server
Easy start/stop server file for mac
Copy to /usr/local/bin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| start() | |
| { | |
| echo "Starting PostgreSQL server" | |
| pg_ctl -D /usr/local/var/postgres -l logfile start | |
| return | |
| } | |
| stop() | |
| { | |
| echo "Stopping PostgreSQL server" | |
| pg_ctl -D /usr/local/var/postgres stop -s -m fast | |
| return | |
| } | |
| case "$1" in | |
| start) | |
| start | |
| ;; | |
| stop) | |
| stop | |
| ;; | |
| restart) | |
| stop | |
| start | |
| ;; | |
| *) | |
| echo "Usage: {start|stop|restart}" | |
| exit 1 | |
| ;; | |
| esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment