Created
September 20, 2018 18:13
-
-
Save bsnyder/42f71713588a618c43631c0d0c160943 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
#!/bin/sh | |
sudo su - postgres -c '/opt/local/lib/postgresql96/bin/pg_ctl -D /opt/local/var/db/postgresql96/defaultdb -l /opt/local/var/log/postgresql96/postgres.log start &' | |
pg_version=$(psql --version | cut -d ' ' -f3) | |
if [ $? -eq 0 ]; then | |
echo "PostgreSQL $pg_version started successfully" | |
exit 0 | |
else | |
echo "PostgreSQL $pg_version did not start in a timely fashion, please see /opt/local/var/log/postgresql96/postgres.log for details" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment