Skip to content

Instantly share code, notes, and snippets.

@patterns
Created January 28, 2019 10:50
Show Gist options
  • Save patterns/c9881f3d6864869c9447ad585030d8ec to your computer and use it in GitHub Desktop.
Save patterns/c9881f3d6864869c9447ad585030d8ec to your computer and use it in GitHub Desktop.
PostgreSQL start/stop/status shell script for the snappy install version
#!/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