Commit 585d78b4 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FIX] if no parameter is given

parent 308414e0
......@@ -2,20 +2,22 @@
if [[ $1 == "" ]]
then echo "USAGE : ./psql gargantext.ini"
fi
else
getter () {
grep $2 $1 | sed "s/^.*= //"
}
USER=$(getter $1 "DB_USER")
NAME=$(getter $1 "DB_NAME")
PASS=$(getter $1 "DB_PASS")
HOST=$(getter $1 "DB_HOST")
PORT=$(getter $1 "DB_PORT")
getter () {
grep $2 $1 | sed "s/^.*= //"
}
USER=$(getter $1 "DB_USER")
NAME=$(getter $1 "DB_NAME")
psql "postgresql://${USER}:${PASS}@${HOST}:${PORT}/${NAME}"
PASS=$(getter $1 "DB_PASS")
HOST=$(getter $1 "DB_HOST")
PORT=$(getter $1 "DB_PORT")
fi
psql "postgresql://${USER}:${PASS}@${HOST}:${PORT}/${NAME}"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment