]> Git — Sourcephile - gargantext.git/blob - bin/psql
[VERSION] +1 to 0.0.6.9.2
[gargantext.git] / bin / psql
1 #!/bin/bash
2
3
4 if [[ $1 == "" ]]
5 then echo "USAGE : ./psql gargantext.ini"
6 else
7
8 INIFILE=$1
9
10 getter () {
11 grep $1 $INIFILE | sed "s/^.*= //"
12 }
13
14 USER=$(getter "DB_USER")
15 NAME=$(getter "DB_NAME")
16 PASS=$(getter "DB_PASS")
17 HOST=$(getter "DB_HOST")
18 PORT=$(getter "DB_PORT")
19
20 # "postgresql://${USER}:${PASS}@${HOST}:${PORT}/${NAME}"
21
22 GARGDB="postgresql://${USER}:${PASS}@${HOST}:${PORT}/${NAME}"
23
24 #echo "connecting to $GARGDB"
25
26 psql "postgresql://${USER}:${PASS}@${HOST}:${PORT}/${NAME}"
27
28 fi
29
30
31