Created
January 28, 2019 10:50
-
-
Save patterns/c9881f3d6864869c9447ad585030d8ec to your computer and use it in GitHub Desktop.
PostgreSQL start/stop/status shell script for the snappy install version
This file contains 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 | |
startpg() { | |
postgresql10.pgctl -D $HOME/snap/postgresql10/common/data -l $HOME/snap/postgresql10/common/logs/logfile start | |
} | |
stoppg() { | |
postgresql10.pgctl -D $HOME/snap/postgresql10/common/data -l $HOME/snap/postgresql10/common/logs/logfile stop | |
} | |
statpg() { | |
postgresql10.pgctl -D $HOME/snap/postgresql10/common/data -l $HOME/snap/postgresql10/common/logs/logfile status | |
} | |
fhirpg() { | |
postgresql10.psql -h 127.0.0.1 -d fhirbase | |
} | |
case "$1" in | |
start) startpg ;; | |
stop) stoppg ;; | |
status) statpg ;; | |
fhirbase) fhirpg ;; | |
*) echo "usage: $0 start|stop|status|fhirbase" >&2 | |
exit 1 | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment