Created
September 9, 2010 19:18
-
-
Save kevn/572375 to your computer and use it in GitHub Desktop.
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/bin/env sh | |
# Kill connections | |
ps -u postgres|grep "postgres: postgres yam_development"|awk '{print $2}'|xargs sudo -u postgres kill -s SIGQUIT | |
ps -u postgres|grep "postgres: postgres yam_test" |awk '{print $2}'|xargs sudo -u postgres kill -s SIGQUIT | |
# Wait for db processes to stop | |
sleep 5 | |
psql84 -Upostgres -c 'DROP DATABASE yam_development' | |
psql84 -Upostgres -c 'DROP DATABASE yam_test' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment