Skip to content

Instantly share code, notes, and snippets.

@csaura
Created March 3, 2013 20:00
Show Gist options
  • Save csaura/5078004 to your computer and use it in GitHub Desktop.
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
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