run psql by default
This commit is contained in:
parent
aff5de16f5
commit
a4a7a6ac8d
@ -21,6 +21,10 @@ main() {
|
|||||||
stop)
|
stop)
|
||||||
pg_ctl -D db -l db/logfile stop
|
pg_ctl -D db -l db/logfile stop
|
||||||
;;
|
;;
|
||||||
|
"")
|
||||||
|
exports
|
||||||
|
psql
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
>&2 echo "Unknown command: '$*'"
|
>&2 echo "Unknown command: '$*'"
|
||||||
exit 1
|
exit 1
|
||||||
@ -28,13 +32,17 @@ main() {
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exports() {
|
||||||
|
export PGHOST=127.0.0.1
|
||||||
|
export PGUSER=osm
|
||||||
|
export PGDATABASE=osm
|
||||||
|
}
|
||||||
|
|
||||||
if [[ "${BASH_SOURCE[0]}" != "${0}" ]]; then
|
if [[ "${BASH_SOURCE[0]}" != "${0}" ]]; then
|
||||||
if [[ $# != 0 ]]; then
|
if [[ $# != 0 ]]; then
|
||||||
>&2 echo "Sourcing does not accept arguments: $*"
|
>&2 echo "Sourcing does not accept arguments: $*"
|
||||||
else
|
else
|
||||||
export PGHOST=127.0.0.1
|
exports
|
||||||
export PGUSER=osm
|
|
||||||
export PGDATABASE=osm
|
|
||||||
>&2 echo "OK: exported PGUSER, PGHOST and PGDATABASE"
|
>&2 echo "OK: exported PGUSER, PGHOST and PGDATABASE"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user