Created
April 17, 2011 17:13
-
-
Save dev4dev/924248 to your computer and use it in GitHub Desktop.
start/stop postgres
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
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
#!/usr/local/bin/ruby | |
if !File.exist?('/usr/local/var/postgres/postmaster.pid') && ARGV[0] == 'start' | |
p %x[pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start] | |
p 'PG Started' | |
end | |
if File.exist?('/usr/local/var/postgres/postmaster.pid') && ARGV[0] == 'stop' | |
%x[pg_ctl -D /usr/local/var/postgres stop -s -m fast] | |
p 'PG Stopped' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment