Skip to content

Instantly share code, notes, and snippets.

@Luminus
Created February 1, 2015 01:13
Show Gist options
  • Save Luminus/469c91823fbf38c06686 to your computer and use it in GitHub Desktop.
Save Luminus/469c91823fbf38c06686 to your computer and use it in GitHub Desktop.
I installed postgresql on my mac using MacPorts and created these scripts so I can easily start and stop the server without going nuts. I put these scripts in my personal /bin at ~/bin/ and run chmod +x on them
#!/bin/bash
sudo su postgres -c '/opt/local/lib/postgresql94/bin/pg_ctl -D /opt/local/var/db/postgresql94/defaultdb -l /opt/local/var/db/postgresql94/defaultdb/postgresql.log start'
#!/bin/bash
sudo su postgres -c '/opt/local/lib/postgresql94/bin/pg_ctl -D /opt/local/var/db/postgresql94/defaultdb stop'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment