From a4a7a6ac8dc72b6318900162e9309800a56cff1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Fri, 22 May 2020 19:28:10 +0300 Subject: [PATCH] run psql by default --- II/Referatas/managedb | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/II/Referatas/managedb b/II/Referatas/managedb index 9a9a79a..017db15 100755 --- a/II/Referatas/managedb +++ b/II/Referatas/managedb @@ -21,6 +21,10 @@ main() { stop) pg_ctl -D db -l db/logfile stop ;; + "") + exports + psql + ;; *) >&2 echo "Unknown command: '$*'" exit 1 @@ -28,13 +32,17 @@ main() { esac } +exports() { + export PGHOST=127.0.0.1 + export PGUSER=osm + export PGDATABASE=osm +} + if [[ "${BASH_SOURCE[0]}" != "${0}" ]]; then if [[ $# != 0 ]]; then >&2 echo "Sourcing does not accept arguments: $*" else - export PGHOST=127.0.0.1 - export PGUSER=osm - export PGDATABASE=osm + exports >&2 echo "OK: exported PGUSER, PGHOST and PGDATABASE" fi else