aboutsummaryrefslogtreecommitdiff
path: root/runmepostgres.sh
diff options
context:
space:
mode:
Diffstat (limited to 'runmepostgres.sh')
-rwxr-xr-xrunmepostgres.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/runmepostgres.sh b/runmepostgres.sh
new file mode 100755
index 0000000..dfa5764
--- /dev/null
+++ b/runmepostgres.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+PGDIR=${1-"$HOME/pg"}
+
+read -p "Press [Enter] key to start Postgres (will already be running if you just got it) use ctl+c to cancel";
+echo "> Starting Server";
+"$PGDIR/postgres/bin/pg_ctl" -D "$PGDIR/postgres/data/" -l POSTGRES_logfile start;
+
+echo "> Conecting as admin user: " + ${USER};
+"$PGDIR/postgres/bin/psql" -U ${USER} postgres;